diff --git a/core/lib/Drupal/Core/Datetime/DateFormatter.php b/core/lib/Drupal/Core/Datetime/DateFormatter.php index 35987b7..9aadb05 100644 --- a/core/lib/Drupal/Core/Datetime/DateFormatter.php +++ b/core/lib/Drupal/Core/Datetime/DateFormatter.php @@ -260,7 +260,7 @@ protected function country() { /** * Setter for country. * - * @param $country_code + * @param string $country_code */ public function setCountry($country_code) { $this->country = $country_code; diff --git a/core/modules/config_translation/src/FormElement/FormElementBase.php b/core/modules/config_translation/src/FormElement/FormElementBase.php index 53cf5ff..1ee5e77 100644 --- a/core/modules/config_translation/src/FormElement/FormElementBase.php +++ b/core/modules/config_translation/src/FormElement/FormElementBase.php @@ -78,7 +78,7 @@ public function getTranslationBuild(LanguageInterface $source_language, Language * {@inheritdoc} */ public function getFormAttributes() { - return array(); + return []; } /** diff --git a/core/modules/config_translation/src/FormElement/ListElement.php b/core/modules/config_translation/src/FormElement/ListElement.php index 3a0c138..4723203 100644 --- a/core/modules/config_translation/src/FormElement/ListElement.php +++ b/core/modules/config_translation/src/FormElement/ListElement.php @@ -100,7 +100,7 @@ public function setConfig(Config $base_config, LanguageConfigOverride $config_tr * {@inheritdoc} */ public function getFormAttributes() { - $attributes = array(); + $attributes = []; foreach ($this->element as $key => $element) { if ($form_element = ConfigTranslationFormBase::createFormElement($element)) { $form_attributes = $form_element->getFormAttributes(); diff --git a/core/modules/system/js/system.date.js b/core/modules/system/js/system.date.js index fcab3ef..4f34a7b 100644 --- a/core/modules/system/js/system.date.js +++ b/core/modules/system/js/system.date.js @@ -9,10 +9,10 @@ */ Drupal.behaviors.dateFormat = { attach: function (context) { - var $context = $(context); - var $source = $context.find('[data-drupal-date-formatter="source"]').once('dateFormat'); - var $target = $context.find('[data-drupal-date-formatter="preview"]').once('dateFormat'); - var $preview = $target.find('em'); + var $context = $(context), + $source = $context.find('[data-drupal-date-formatter="source"]').once('dateFormat'), + $target = $context.find('[data-drupal-date-formatter="preview"]').once('dateFormat'), + $preview = $target.find('em'); // All elements have to exist. if (!$source.length || !$target.length) { @@ -25,8 +25,8 @@ * @param {object} e */ function dateFormatHandler(e) { - var baseValue = $(e.target).val() || ''; - var dateString = baseValue.replace(/\\?(.?)/gi, function (key, value) { + var baseValue = $(e.target).val() || '', + dateString = baseValue.replace(/\\?(.?)/gi, function (key, value) { return dateFormats[key] ? dateFormats[key] : value; }); diff --git a/core/modules/system/src/Form/DateFormatFormBase.php b/core/modules/system/src/Form/DateFormatFormBase.php index 69f1d95..9061d89 100644 --- a/core/modules/system/src/Form/DateFormatFormBase.php +++ b/core/modules/system/src/Form/DateFormatFormBase.php @@ -108,10 +108,10 @@ public function form(array $form, FormStateInterface $form_state) { '#maxlength' => 100, '#description' => $this->t('A user-defined date format. See the PHP manual for available options.', array('@url' => 'http://php.net/manual/function.date.php')), '#required' => TRUE, - '#attributes' => array( + '#attributes' => [ 'data-drupal-date-formatter' => 'source', - ), - '#field_suffix' => ' ' . $this->t('Displayed as %date_format', array('%date_format' => '')) . '', + ], + '#field_suffix' => ' ' . $this->t('Displayed as %date_format', ['%date_format' => '']) . '', ); $form['langcode'] = array(