diff --git a/core/lib/Drupal.php b/core/lib/Drupal.php index 711028b..a20a5ee 100644 --- a/core/lib/Drupal.php +++ b/core/lib/Drupal.php @@ -693,4 +693,14 @@ public static function entityDefinitionUpdateManager() { return static::getContainer()->get('entity.definition_update_manager'); } + /** + * Returns the date formatter service. + * + * @return \Drupal\Core\Datetime\DateFormatterInterface + * The date formatter service. + */ + public static function dateFormatter() { + return static::getContainer()->get('date.formatter'); + } + } diff --git a/core/lib/Drupal/Core/Datetime/DateFormatter.php b/core/lib/Drupal/Core/Datetime/DateFormatter.php index a1cd4a0..be23303 100644 --- a/core/lib/Drupal/Core/Datetime/DateFormatter.php +++ b/core/lib/Drupal/Core/Datetime/DateFormatter.php @@ -21,7 +21,7 @@ * * @ingroup i18n */ -class DateFormatter { +class DateFormatter implements DateFormatterInterface { use StringTranslationTrait; /** @@ -104,34 +104,7 @@ public function __construct(EntityManagerInterface $entity_manager, LanguageMana } /** - * Formats a date, using a date type or a custom date format string. - * - * @param int $timestamp - * A UNIX timestamp to format. - * @param string $type - * (optional) The format to use, one of: - * - One of the built-in formats: 'short', 'medium', - * 'long', 'html_datetime', 'html_date', 'html_time', - * 'html_yearless_date', 'html_week', 'html_month', 'html_year'. - * - The name of a date type defined by a date format config entity. - * - The machine name of an administrator-defined date format. - * - 'custom', to use $format. - * Defaults to 'medium'. - * @param string $format - * (optional) If $type is 'custom', a PHP date format string suitable for - * input to date(). Use a backslash to escape ordinary text, so it does not - * get interpreted as date format characters. - * @param string|null $timezone - * (optional) Time zone identifier, as described at - * http://php.net/manual/timezones.php Defaults to the time zone used to - * display the page. - * @param string|null $langcode - * (optional) Language code to translate to. NULL (default) means to use - * the user interface language for the page. - * - * @return string - * A translated date string in the requested format. Since the format may - * contain user input, this value should be escaped when output. + * {@inheritdoc} */ public function format($timestamp, $type = 'medium', $format = '', $timezone = NULL, $langcode = NULL) { if (!isset($timezone)) { @@ -172,28 +145,7 @@ public function format($timestamp, $type = 'medium', $format = '', $timezone = N } /** - * Formats a time interval with the requested granularity. - * - * Note that for intervals over 30 days, the output is approximate: a "month" - * is always exactly 30 days, and a "year" is always 365 days. It is not - * possible to make a more exact representation, given that there is only one - * input in seconds. If you are formatting an interval between two specific - * timestamps, use \Drupal\Core\Datetime\DateFormatter::formatDiff() instead. - * - * @param int $interval - * The length of the interval in seconds. - * @param int $granularity - * (optional) How many different units to display in the string (2 by - * default). - * @param string|null $langcode - * (optional) langcode: The language code for the language used to format - * the date. Defaults to NULL, which results in the user interface language - * for the page being used. - * - * @return string - * A translated string representation of the interval. - * - * @see \Drupal\Core\Datetime\DateFormatter::formatDiff() + * {@inheritdoc} */ public function formatInterval($interval, $granularity = 2, $langcode = NULL) { $output = ''; @@ -218,21 +170,7 @@ public function formatInterval($interval, $granularity = 2, $langcode = NULL) { } /** - * Provides values for all date formatting characters for a given timestamp. - * - * @param string|null $langcode - * (optional) Language code of the date format, if different from the site - * default language. - * @param int|null $timestamp - * (optional) The Unix timestamp to format, defaults to current time. - * @param string|null $timezone - * (optional) The timezone to use, if different from the site's default - * timezone. - * - * @return array - * An array of formatted date values, indexed by the date format character. - * - * @see date() + * {@inheritdoc} */ public function getSampleDateFormats($langcode = NULL, $timestamp = NULL, $timezone = NULL) { $timestamp = $timestamp ?: time(); @@ -245,30 +183,7 @@ public function getSampleDateFormats($langcode = NULL, $timestamp = NULL, $timez } /** - * Formats the time difference from the current request time to a timestamp. - * - * @param $timestamp - * A UNIX timestamp to compare against the current request time. - * @param array $options - * (optional) An associative array with additional options. The following - * keys can be used: - * - granularity: An integer value that signals how many different units to - * display in the string. Defaults to 2. - * - langcode: The language code for the language used to format the date. - * Defaults to NULL, which results in the user interface language for the - * page being used. - * - strict: A Boolean value indicating whether or not the timestamp can be - * before the current request time. If TRUE (default) and $timestamp is - * before the current request time, the result string will be "0 seconds". - * If FALSE and $timestamp is before the current request time, the result - * string will be the formatted time difference. - * - * @return string - * A translated string representation of the difference between the given - * timestamp and the current request time. This interval is always positive. - * - * @see \Drupal\Core\Datetime\DateFormatter::formatDiff() - * @see \Drupal\Core\Datetime\DateFormatter::formatTimeDiffSince() + * {@inheritdoc} */ public function formatTimeDiffUntil($timestamp, $options = array()) { $request_time = $this->requestStack->getCurrentRequest()->server->get('REQUEST_TIME'); @@ -276,30 +191,7 @@ public function formatTimeDiffUntil($timestamp, $options = array()) { } /** - * Formats the time difference from a timestamp to the current request time. - * - * @param $timestamp - * A UNIX timestamp to compare against the current request time. - * @param array $options - * (optional) An associative array with additional options. The following - * keys can be used: - * - granularity: An integer value that signals how many different units to - * display in the string. Defaults to 2. - * - langcode: The language code for the language used to format the date. - * Defaults to NULL, which results in the user interface language for the - * page being used. - * - strict: A Boolean value indicating whether or not the timestamp can be - * after the current request time. If TRUE (default) and $timestamp is - * after the current request time, the result string will be "0 seconds". - * If FALSE and $timestamp is after the current request time, the result - * string will be the formatted time difference. - * - * @return string - * A translated string representation of the difference between the given - * timestamp and the current request time. This interval is always positive. - * - * @see \Drupal\Core\Datetime\DateFormatter::formatDiff() - * @see \Drupal\Core\Datetime\DateFormatter::formatTimeDiffUntil() + * {@inheritdoc} */ public function formatTimeDiffSince($timestamp, $options = array()) { $request_time = $this->requestStack->getCurrentRequest()->server->get('REQUEST_TIME'); @@ -307,32 +199,7 @@ public function formatTimeDiffSince($timestamp, $options = array()) { } /** - * Formats a time interval between two timestamps. - * - * @param int $from - * A UNIX timestamp, defining the from date and time. - * @param int $to - * A UNIX timestamp, defining the to date and time. - * @param array $options - * (optional) An associative array with additional options. The following - * keys can be used: - * - granularity: An integer value that signals how many different units to - * display in the string. Defaults to 2. - * - langcode: The language code for the language used to format the date. - * Defaults to NULL, which results in the user interface language for the - * page being used. - * - strict: A Boolean value indicating whether or not the $from timestamp - * can be after the $to timestamp. If TRUE (default) and $from is after - * $to, the result string will be "0 seconds". If FALSE and $from is - * after $to, the result string will be the formatted time difference. - * - * @return string - * A translated string representation of the interval. This interval is - * always positive. - * - * @see \Drupal\Core\Datetime\DateFormatter::formatInterval() - * @see \Drupal\Core\Datetime\DateFormatter::formatTimeDiffSince() - * @see \Drupal\Core\Datetime\DateFormatter::formatTimeDiffUntil() + * {@inheritdoc} */ public function formatDiff($from, $to, $options = array()) { diff --git a/core/lib/Drupal/Core/Datetime/DateFormatterInterface.php b/core/lib/Drupal/Core/Datetime/DateFormatterInterface.php new file mode 100644 index 0000000..235e338 --- /dev/null +++ b/core/lib/Drupal/Core/Datetime/DateFormatterInterface.php @@ -0,0 +1,178 @@ +dateFormatter = $date_formatter; diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/TimestampFormatter.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/TimestampFormatter.php index 032e1d1..b6abbd5 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/TimestampFormatter.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/TimestampFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\Core\Field\Plugin\Field\FieldFormatter; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldItemListInterface; @@ -34,7 +34,7 @@ class TimestampFormatter extends FormatterBase implements ContainerFactoryPlugin /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; @@ -62,12 +62,12 @@ class TimestampFormatter extends FormatterBase implements ContainerFactoryPlugin * The view mode. * @param array $third_party_settings * Third party settings. - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date formatter service. * @param \Drupal\Core\Entity\EntityStorageInterface $date_format_storage * The date format storage. */ - public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, DateFormatter $date_formatter, EntityStorageInterface $date_format_storage) { + public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, DateFormatterInterface $date_formatter, EntityStorageInterface $date_format_storage) { parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings); $this->dateFormatter = $date_formatter; diff --git a/core/modules/aggregator/src/Controller/AggregatorController.php b/core/modules/aggregator/src/Controller/AggregatorController.php index 54f4fbb..70c6697 100644 --- a/core/modules/aggregator/src/Controller/AggregatorController.php +++ b/core/modules/aggregator/src/Controller/AggregatorController.php @@ -9,7 +9,7 @@ use Drupal\Component\Utility\Xss; use Drupal\Core\Controller\ControllerBase; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\aggregator\FeedInterface; use Drupal\Core\Url; use Symfony\Component\HttpFoundation\Request; @@ -24,17 +24,17 @@ class AggregatorController extends ControllerBase { /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; /** * Constructs a \Drupal\aggregator\Controller\AggregatorController object. * - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date formatter service. */ - public function __construct(DateFormatter $date_formatter) { + public function __construct(DateFormatterInterface $date_formatter) { $this->dateFormatter = $date_formatter; } diff --git a/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php b/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php index 0c98c67..21a67dd 100644 --- a/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php +++ b/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php @@ -14,7 +14,7 @@ use Drupal\Component\Utility\Unicode; use Drupal\Core\Database\Database; use Drupal\Core\Config\ConfigFactoryInterface; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Entity\Query\QueryInterface; use Drupal\Core\Form\ConfigFormBaseTrait; use Drupal\Core\Form\FormStateInterface; @@ -61,7 +61,7 @@ class DefaultProcessor extends AggregatorPluginSettingsBase implements Processor /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; @@ -80,10 +80,10 @@ class DefaultProcessor extends AggregatorPluginSettingsBase implements Processor * The entity query object for feed items. * @param \Drupal\aggregator\ItemStorageInterface $item_storage * The entity storage for feed items. - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date formatter service. */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, ConfigFactoryInterface $config, QueryInterface $item_query, ItemStorageInterface $item_storage, DateFormatter $date_formatter) { + public function __construct(array $configuration, $plugin_id, $plugin_definition, ConfigFactoryInterface $config, QueryInterface $item_query, ItemStorageInterface $item_storage, DateFormatterInterface $date_formatter) { $this->configFactory = $config; $this->itemStorage = $item_storage; $this->itemQuery = $item_query; diff --git a/core/modules/comment/src/Form/CommentAdminOverview.php b/core/modules/comment/src/Form/CommentAdminOverview.php index 97515b2..df9b132 100644 --- a/core/modules/comment/src/Form/CommentAdminOverview.php +++ b/core/modules/comment/src/Form/CommentAdminOverview.php @@ -10,7 +10,7 @@ use Drupal\comment\CommentInterface; use Drupal\comment\CommentStorageInterface; use Drupal\Component\Utility\Unicode; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\FormBase; @@ -39,7 +39,7 @@ class CommentAdminOverview extends FormBase { /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; @@ -57,12 +57,12 @@ class CommentAdminOverview extends FormBase { * The entity manager service. * @param \Drupal\comment\CommentStorageInterface $comment_storage * The comment storage. - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date formatter service. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler. */ - public function __construct(EntityManagerInterface $entity_manager, CommentStorageInterface $comment_storage, DateFormatter $date_formatter, ModuleHandlerInterface $module_handler) { + public function __construct(EntityManagerInterface $entity_manager, CommentStorageInterface $comment_storage, DateFormatterInterface $date_formatter, ModuleHandlerInterface $module_handler) { $this->entityManager = $entity_manager; $this->commentStorage = $comment_storage; $this->dateFormatter = $date_formatter; diff --git a/core/modules/config_translation/src/FormElement/DateFormat.php b/core/modules/config_translation/src/FormElement/DateFormat.php index 637ebfe..6395a92 100644 --- a/core/modules/config_translation/src/FormElement/DateFormat.php +++ b/core/modules/config_translation/src/FormElement/DateFormat.php @@ -18,7 +18,7 @@ class DateFormat extends FormElementBase { * {@inheritdoc} */ public function getTranslationElement(LanguageInterface $translation_language, $source_config, $translation_config) { - /** @var \Drupal\Core\Datetime\DateFormatter $date_formatter */ + /** @var \Drupal\Core\Datetime\DateFormatterInterface $date_formatter */ $date_formatter = \Drupal::service('date.formatter'); $description = $this->t('A user-defined date format. See the PHP manual for available options.', array(':url' => 'http://php.net/manual/function.date.php')); $format = $this->t('Displayed as %date_format', array('%date_format' => $date_formatter->format(REQUEST_TIME, 'custom', $translation_config))); diff --git a/core/modules/contact/src/MessageForm.php b/core/modules/contact/src/MessageForm.php index 9cb5e54..fec2ca8 100644 --- a/core/modules/contact/src/MessageForm.php +++ b/core/modules/contact/src/MessageForm.php @@ -8,7 +8,7 @@ namespace Drupal\contact; use Drupal\Component\Utility\SafeMarkup; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Entity\ContentEntityForm; use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Flood\FloodInterface; @@ -53,7 +53,7 @@ class MessageForm extends ContentEntityForm { /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; @@ -68,10 +68,10 @@ class MessageForm extends ContentEntityForm { * The language manager service. * @param \Drupal\contact\MailHandlerInterface $mail_handler * The contact mail handler service. - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date service. */ - public function __construct(EntityManagerInterface $entity_manager, FloodInterface $flood, LanguageManagerInterface $language_manager, MailHandlerInterface $mail_handler, DateFormatter $date_formatter) { + public function __construct(EntityManagerInterface $entity_manager, FloodInterface $flood, LanguageManagerInterface $language_manager, MailHandlerInterface $mail_handler, DateFormatterInterface $date_formatter) { parent::__construct($entity_manager); $this->flood = $flood; $this->languageManager = $language_manager; diff --git a/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeFormatterBase.php b/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeFormatterBase.php index aad8c16..b146fbb 100644 --- a/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeFormatterBase.php +++ b/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeFormatterBase.php @@ -7,7 +7,7 @@ namespace Drupal\datetime\Plugin\Field\FieldFormatter; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Datetime\DrupalDateTime; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Field\FieldDefinitionInterface; @@ -25,7 +25,7 @@ /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; @@ -53,12 +53,12 @@ * The view mode. * @param array $third_party_settings * Third party settings. - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date formatter service. * @param \Drupal\Core\Entity\EntityStorageInterface $date_format_storage * The date format entity storage. */ - public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, DateFormatter $date_formatter, EntityStorageInterface $date_format_storage) { + public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, DateFormatterInterface $date_formatter, EntityStorageInterface $date_format_storage) { parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings); $this->dateFormatter = $date_formatter; diff --git a/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeTimeAgoFormatter.php b/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeTimeAgoFormatter.php index 0bc56c6..f6b85b0 100644 --- a/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeTimeAgoFormatter.php +++ b/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeTimeAgoFormatter.php @@ -8,7 +8,7 @@ namespace Drupal\datetime\Plugin\Field\FieldFormatter; use Drupal\Component\Utility\SafeMarkup; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Datetime\DrupalDateTime; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldItemListInterface; @@ -34,7 +34,7 @@ class DateTimeTimeAgoFormatter extends FormatterBase implements ContainerFactory /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; @@ -62,12 +62,12 @@ class DateTimeTimeAgoFormatter extends FormatterBase implements ContainerFactory * The view mode. * @param array $third_party_settings * Third party settings. - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date formatter service. * @param \Symfony\Component\HttpFoundation\Request $request * The current request. */ - public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, DateFormatter $date_formatter, Request $request) { + public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, DateFormatterInterface $date_formatter, Request $request) { parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings); $this->dateFormatter = $date_formatter; diff --git a/core/modules/datetime/src/Plugin/views/filter/Date.php b/core/modules/datetime/src/Plugin/views/filter/Date.php index cc3caf7..e3553de 100644 --- a/core/modules/datetime/src/Plugin/views/filter/Date.php +++ b/core/modules/datetime/src/Plugin/views/filter/Date.php @@ -7,7 +7,7 @@ namespace Drupal\datetime\Plugin\views\filter; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem; use Drupal\views\FieldAPIHandlerTrait; @@ -32,7 +32,7 @@ class Date extends NumericDate implements ContainerFactoryPluginInterface { /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; @@ -61,12 +61,12 @@ class Date extends NumericDate implements ContainerFactoryPluginInterface { * The plugin ID for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date formatter service. * @param \Symfony\Component\HttpFoundation\RequestStack * The request stack used to determine the current time. */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, DateFormatter $date_formatter, RequestStack $request_stack) { + public function __construct(array $configuration, $plugin_id, $plugin_definition, DateFormatterInterface $date_formatter, RequestStack $request_stack) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->dateFormatter = $date_formatter; $this->requestStack = $request_stack; diff --git a/core/modules/dblog/src/Controller/DbLogController.php b/core/modules/dblog/src/Controller/DbLogController.php index eff6626..01d86ef 100644 --- a/core/modules/dblog/src/Controller/DbLogController.php +++ b/core/modules/dblog/src/Controller/DbLogController.php @@ -11,7 +11,7 @@ use Drupal\Component\Utility\Unicode; use Drupal\Core\Controller\ControllerBase; use Drupal\Core\Database\Connection; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\FormBuilderInterface; use Drupal\Core\Logger\RfcLogLevel; @@ -41,7 +41,7 @@ class DbLogController extends ControllerBase { /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; @@ -78,12 +78,12 @@ public static function create(ContainerInterface $container) { * A database connection. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * A module handler. - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date formatter service. * @param \Drupal\Core\Form\FormBuilderInterface $form_builder * The form builder service. */ - public function __construct(Connection $database, ModuleHandlerInterface $module_handler, DateFormatter $date_formatter, FormBuilderInterface $form_builder) { + public function __construct(Connection $database, ModuleHandlerInterface $module_handler, DateFormatterInterface $date_formatter, FormBuilderInterface $form_builder) { $this->database = $database; $this->moduleHandler = $module_handler; $this->dateFormatter = $date_formatter; diff --git a/core/modules/node/src/Controller/NodeController.php b/core/modules/node/src/Controller/NodeController.php index 299d253..c34062d 100644 --- a/core/modules/node/src/Controller/NodeController.php +++ b/core/modules/node/src/Controller/NodeController.php @@ -9,7 +9,7 @@ use Drupal\Component\Utility\Xss; use Drupal\Core\Controller\ControllerBase; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Render\RendererInterface; use Drupal\Core\Url; @@ -25,7 +25,7 @@ class NodeController extends ControllerBase implements ContainerInjectionInterfa /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; @@ -39,12 +39,12 @@ class NodeController extends ControllerBase implements ContainerInjectionInterfa /** * Constructs a NodeController object. * - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date formatter service. * @param \Drupal\Core\Render\RendererInterface $renderer * The renderer service. */ - public function __construct(DateFormatter $date_formatter, RendererInterface $renderer) { + public function __construct(DateFormatterInterface $date_formatter, RendererInterface $renderer) { $this->dateFormatter = $date_formatter; $this->renderer = $renderer; } diff --git a/core/modules/node/src/NodeListBuilder.php b/core/modules/node/src/NodeListBuilder.php index 26f2876..35013f6 100644 --- a/core/modules/node/src/NodeListBuilder.php +++ b/core/modules/node/src/NodeListBuilder.php @@ -7,7 +7,7 @@ namespace Drupal\node; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityListBuilder; use Drupal\Core\Entity\EntityStorageInterface; @@ -26,7 +26,7 @@ class NodeListBuilder extends EntityListBuilder { /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; @@ -44,12 +44,12 @@ class NodeListBuilder extends EntityListBuilder { * The entity type definition. * @param \Drupal\Core\Entity\EntityStorageInterface $storage * The entity storage class. - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date formatter service. * @param \Drupal\Core\Routing\RedirectDestinationInterface $redirect_destination * The redirect destination service. */ - public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, DateFormatter $date_formatter, RedirectDestinationInterface $redirect_destination) { + public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, DateFormatterInterface $date_formatter, RedirectDestinationInterface $redirect_destination) { parent::__construct($entity_type, $storage); $this->dateFormatter = $date_formatter; diff --git a/core/modules/system/src/DateFormatListBuilder.php b/core/modules/system/src/DateFormatListBuilder.php index 2f052d9..24a9ea0 100644 --- a/core/modules/system/src/DateFormatListBuilder.php +++ b/core/modules/system/src/DateFormatListBuilder.php @@ -8,7 +8,7 @@ namespace Drupal\system; use Drupal\Core\Config\Entity\ConfigEntityListBuilder; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; @@ -24,7 +24,7 @@ class DateFormatListBuilder extends ConfigEntityListBuilder { /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; @@ -35,10 +35,10 @@ class DateFormatListBuilder extends ConfigEntityListBuilder { * The entity type definition. * @param \Drupal\Core\Entity\EntityStorageInterface $storage * The entity storage class. - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date formatter service. */ - public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, DateFormatter $date_formatter) { + public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, DateFormatterInterface $date_formatter) { parent::__construct($entity_type, $storage); $this->dateFormatter = $date_formatter; diff --git a/core/modules/system/src/Form/CronForm.php b/core/modules/system/src/Form/CronForm.php index e75c156..8d9545c 100644 --- a/core/modules/system/src/Form/CronForm.php +++ b/core/modules/system/src/Form/CronForm.php @@ -9,7 +9,7 @@ use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\CronInterface; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\State\StateInterface; use Drupal\Core\Form\ConfigFormBase; @@ -38,7 +38,7 @@ class CronForm extends ConfigFormBase { /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; @@ -51,10 +51,10 @@ class CronForm extends ConfigFormBase { * The state key value store. * @param \Drupal\Core\CronInterface $cron * The cron service. - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date formatter service. */ - public function __construct(ConfigFactoryInterface $config_factory, StateInterface $state, CronInterface $cron, DateFormatter $date_formatter) { + public function __construct(ConfigFactoryInterface $config_factory, StateInterface $state, CronInterface $cron, DateFormatterInterface $date_formatter) { parent::__construct($config_factory); $this->state = $state; $this->cron = $cron; diff --git a/core/modules/system/src/Form/DateFormatDeleteForm.php b/core/modules/system/src/Form/DateFormatDeleteForm.php index 009700e..93d2141 100644 --- a/core/modules/system/src/Form/DateFormatDeleteForm.php +++ b/core/modules/system/src/Form/DateFormatDeleteForm.php @@ -7,7 +7,7 @@ namespace Drupal\system\Form; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Entity\EntityDeleteForm; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -19,17 +19,17 @@ class DateFormatDeleteForm extends EntityDeleteForm { /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; /** * Constructs an DateFormatDeleteForm object. * - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date formatter service. */ - public function __construct(DateFormatter $date_formatter) { + public function __construct(DateFormatterInterface $date_formatter) { $this->dateFormatter = $date_formatter; } diff --git a/core/modules/system/src/Form/DateFormatFormBase.php b/core/modules/system/src/Form/DateFormatFormBase.php index 964ae96..252fba4 100644 --- a/core/modules/system/src/Form/DateFormatFormBase.php +++ b/core/modules/system/src/Form/DateFormatFormBase.php @@ -8,7 +8,7 @@ namespace Drupal\system\Form; use Drupal\Core\Config\Entity\ConfigEntityStorageInterface; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Language\LanguageInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -23,7 +23,7 @@ /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; @@ -37,12 +37,12 @@ /** * Constructs a new date format form. * - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date service. * @param \Drupal\Core\Config\Entity\ConfigEntityStorageInterface $date_format_storage * The date format storage. */ - public function __construct(DateFormatter $date_formatter, ConfigEntityStorageInterface $date_format_storage) { + public function __construct(DateFormatterInterface $date_formatter, ConfigEntityStorageInterface $date_format_storage) { $date = new DrupalDateTime(); $this->dateFormatter = $date_formatter; diff --git a/core/modules/system/src/Form/FileSystemForm.php b/core/modules/system/src/Form/FileSystemForm.php index 002d7f7..7278c0c 100644 --- a/core/modules/system/src/Form/FileSystemForm.php +++ b/core/modules/system/src/Form/FileSystemForm.php @@ -8,7 +8,7 @@ namespace Drupal\system\Form; use Drupal\Core\Config\ConfigFactoryInterface; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\StreamWrapper\PrivateStream; use Drupal\Core\StreamWrapper\PublicStream; @@ -25,7 +25,7 @@ class FileSystemForm extends ConfigFormBase { /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; @@ -41,12 +41,12 @@ class FileSystemForm extends ConfigFormBase { * * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory * The factory for configuration objects. - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date formatter service. * @param \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface $stream_wrapper_manager * The stream wrapper manager. */ - public function __construct(ConfigFactoryInterface $config_factory, DateFormatter $date_formatter, StreamWrapperManagerInterface $stream_wrapper_manager) { + public function __construct(ConfigFactoryInterface $config_factory, DateFormatterInterface $date_formatter, StreamWrapperManagerInterface $stream_wrapper_manager) { parent::__construct($config_factory); $this->dateFormatter = $date_formatter; $this->streamWrapperManager = $stream_wrapper_manager; diff --git a/core/modules/system/src/Form/PerformanceForm.php b/core/modules/system/src/Form/PerformanceForm.php index 4d28ac7..e6899dc 100644 --- a/core/modules/system/src/Form/PerformanceForm.php +++ b/core/modules/system/src/Form/PerformanceForm.php @@ -11,7 +11,7 @@ use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Cache\CacheBackendInterface; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Form\FormStateInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -30,7 +30,7 @@ class PerformanceForm extends ConfigFormBase { /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; @@ -54,14 +54,14 @@ class PerformanceForm extends ConfigFormBase { * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory * The factory for configuration objects. * @param \Drupal\Core\Cache\CacheBackendInterface $render_cache - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date formatter service. * @param \Drupal\Core\Asset\AssetCollectionOptimizerInterface $css_collection_optimizer * The CSS asset collection optimizer service. * @param \Drupal\Core\Asset\AssetCollectionOptimizerInterface $js_collection_optimizer * The JavaScript asset collection optimizer service. */ - public function __construct(ConfigFactoryInterface $config_factory, CacheBackendInterface $render_cache, DateFormatter $date_formatter, AssetCollectionOptimizerInterface $css_collection_optimizer, AssetCollectionOptimizerInterface $js_collection_optimizer) { + public function __construct(ConfigFactoryInterface $config_factory, CacheBackendInterface $render_cache, DateFormatterInterface $date_formatter, AssetCollectionOptimizerInterface $css_collection_optimizer, AssetCollectionOptimizerInterface $js_collection_optimizer) { parent::__construct($config_factory); $this->renderCache = $render_cache; diff --git a/core/modules/user/src/Controller/UserController.php b/core/modules/user/src/Controller/UserController.php index 21c81a2..7897a91 100644 --- a/core/modules/user/src/Controller/UserController.php +++ b/core/modules/user/src/Controller/UserController.php @@ -9,7 +9,7 @@ use Drupal\Component\Utility\Xss; use Drupal\Core\Controller\ControllerBase; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\user\UserDataInterface; use Drupal\user\UserInterface; use Drupal\user\UserStorageInterface; @@ -24,7 +24,7 @@ class UserController extends ControllerBase { /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; @@ -45,14 +45,14 @@ class UserController extends ControllerBase { /** * Constructs a UserController object. * - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date formatter service. * @param \Drupal\user\UserStorageInterface $user_storage * The user storage. * @param \Drupal\user\UserDataInterface $user_data * The user data service. */ - public function __construct(DateFormatter $date_formatter, UserStorageInterface $user_storage, UserDataInterface $user_data) { + public function __construct(DateFormatterInterface $date_formatter, UserStorageInterface $user_storage, UserDataInterface $user_data) { $this->dateFormatter = $date_formatter; $this->userStorage = $user_storage; $this->userData = $user_data; diff --git a/core/modules/user/src/UserListBuilder.php b/core/modules/user/src/UserListBuilder.php index 85b52f2..a61ce89 100644 --- a/core/modules/user/src/UserListBuilder.php +++ b/core/modules/user/src/UserListBuilder.php @@ -7,7 +7,7 @@ namespace Drupal\user; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityListBuilder; use Drupal\Core\Entity\EntityStorageInterface; @@ -33,7 +33,7 @@ class UserListBuilder extends EntityListBuilder { /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; @@ -53,12 +53,12 @@ class UserListBuilder extends EntityListBuilder { * The entity storage class. * @param \Drupal\Core\Entity\Query\QueryFactory $query_factory * The entity query factory. - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date formatter service. * @param \Drupal\Core\Routing\RedirectDestinationInterface $redirect_destination * The redirect destination service. */ - public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, QueryFactory $query_factory, DateFormatter $date_formatter, RedirectDestinationInterface $redirect_destination) { + public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, QueryFactory $query_factory, DateFormatterInterface $date_formatter, RedirectDestinationInterface $redirect_destination) { parent::__construct($entity_type, $storage); $this->queryFactory = $query_factory; $this->dateFormatter = $date_formatter; diff --git a/core/modules/views/src/Plugin/views/cache/Time.php b/core/modules/views/src/Plugin/views/cache/Time.php index d14ed1c..9ef1cd1e 100644 --- a/core/modules/views/src/Plugin/views/cache/Time.php +++ b/core/modules/views/src/Plugin/views/cache/Time.php @@ -7,7 +7,7 @@ namespace Drupal\views\Plugin\views\cache; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Cache\Cache; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Form\FormStateInterface; @@ -34,7 +34,7 @@ class Time extends CachePluginBase { /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; @@ -54,12 +54,12 @@ class Time extends CachePluginBase { * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date formatter service. * @param \Symfony\Component\HttpFoundation\Request $request * The current request. */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, DateFormatter $date_formatter, Request $request) { + public function __construct(array $configuration, $plugin_id, $plugin_definition, DateFormatterInterface $date_formatter, Request $request) { $this->dateFormatter = $date_formatter; $this->request = $request; diff --git a/core/modules/views/src/Plugin/views/field/Date.php b/core/modules/views/src/Plugin/views/field/Date.php index 340518c..517026f 100644 --- a/core/modules/views/src/Plugin/views/field/Date.php +++ b/core/modules/views/src/Plugin/views/field/Date.php @@ -11,7 +11,7 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\views\ResultRow; use Symfony\Component\DependencyInjection\ContainerInterface; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; /** * A handler to provide proper displays for dates. @@ -25,7 +25,7 @@ class Date extends FieldPluginBase { /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; @@ -45,12 +45,12 @@ class Date extends FieldPluginBase { * The plugin ID for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date formatter service. * @param \Drupal\Core\Entity\EntityStorageInterface $date_format_storage * The date format storage. */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, DateFormatter $date_formatter, EntityStorageInterface $date_format_storage) { + public function __construct(array $configuration, $plugin_id, $plugin_definition, DateFormatterInterface $date_formatter, EntityStorageInterface $date_format_storage) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->dateFormatter = $date_formatter; diff --git a/core/modules/views/src/Plugin/views/field/TimeInterval.php b/core/modules/views/src/Plugin/views/field/TimeInterval.php index 08ebef7..4c91421 100644 --- a/core/modules/views/src/Plugin/views/field/TimeInterval.php +++ b/core/modules/views/src/Plugin/views/field/TimeInterval.php @@ -7,7 +7,7 @@ namespace Drupal\views\Plugin\views\field; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\views\ResultRow; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -24,7 +24,7 @@ class TimeInterval extends FieldPluginBase { /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; @@ -37,10 +37,10 @@ class TimeInterval extends FieldPluginBase { * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date formatter service. */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, DateFormatter $date_formatter) { + public function __construct(array $configuration, $plugin_id, $plugin_definition, DateFormatterInterface $date_formatter) { $this->dateFormatter = $date_formatter; parent::__construct($configuration, $plugin_id, $plugin_definition); } diff --git a/core/modules/views_ui/src/ViewEditForm.php b/core/modules/views_ui/src/ViewEditForm.php index 818984a..e225fd9 100644 --- a/core/modules/views_ui/src/ViewEditForm.php +++ b/core/modules/views_ui/src/ViewEditForm.php @@ -13,7 +13,7 @@ use Drupal\Core\Ajax\AjaxResponse; use Drupal\Core\Ajax\HtmlCommand; use Drupal\Core\Ajax\ReplaceCommand; -use Drupal\Core\Datetime\DateFormatter; +use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Component\Utility\NestedArray; use Drupal\Component\Utility\SafeMarkup; use Drupal\Core\Form\FormStateInterface; @@ -48,7 +48,7 @@ class ViewEditForm extends ViewFormBase { /** * The date formatter service. * - * @var \Drupal\Core\Datetime\DateFormatter + * @var \Drupal\Core\Datetime\DateFormatterInterface */ protected $dateFormatter; @@ -66,12 +66,12 @@ class ViewEditForm extends ViewFormBase { * The factory for the temp store object. * @param \Symfony\Component\HttpFoundation\RequestStack $requestStack * The request stack object. - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter + * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter * The date Formatter service. * @param \Drupal\Core\Render\ElementInfoManagerInterface $element_info * The element info manager. */ - public function __construct(SharedTempStoreFactory $temp_store_factory, RequestStack $requestStack, DateFormatter $date_formatter, ElementInfoManagerInterface $element_info) { + public function __construct(SharedTempStoreFactory $temp_store_factory, RequestStack $requestStack, DateFormatterInterface $date_formatter, ElementInfoManagerInterface $element_info) { $this->tempStore = $temp_store_factory->get('views'); $this->requestStack = $requestStack; $this->dateFormatter = $date_formatter;