We have to convert the module to use short array syntax as per new coding standards.

CommentFileSizeAuthor
#2 name_short_syntax_2971011_2.patch28.92 KBnkoporec

Comments

nkoporec created an issue. See original summary.

nkoporec’s picture

Assigned: nkoporec » Unassigned
Status: Active » Needs review
StatusFileSize
new28.92 KB

Created a patch.

alan d.’s picture

Webform section is a bit redundant. Not sure if I'm going to port this or just ignore, but no issues & don't re-roll.

Couple missed in comments, but again, no need to re-roll

--- a/name.module
+++ b/name.module
@@ -7,7 +7,7 @@
  * TODO: Make sure that all labels are based on the _name_translations()
  * function and use a name:: prefix. This can be parsed out here to allow
  * string overrides to work and to integrate with i18n too.
- * t('@name_given', array('@name_given' => t('Given')))
+ * t('@name_given', ['@name_given' => t('Given')])
  */
--- a/src/Tests/NameFieldTest.php
+++ b/src/Tests/NameFieldTest.php
@@ -132,8 +132,8 @@ class NameFieldTest extends NameTestBase {
     $required_messages = [
       /*
       t('@components can not be selected for @label when they are not selected for @label2.',
-              array('@label' => t('Minimum components'), '@label2' => t('Components'),
-              '@components' => Html::escape(implode(', ', array($n['title'], $n['generational'], $n['credentials']))))),
+              ['@label' => t('Minimum components'), '@label2' => t('Components'),
+              '@components' => Html::escape(implode(', ', [$n['title'], $n['generational'], $n['credentials']]))]),
       */
 
       t('@field must be higher than or equal to 1.', ['@field' => $n['title']]),
@@ -256,8 +256,8 @@ class NameFieldTest extends NameTestBase {
     $required_messages = [
       /*
       t('@components can not be selected for @label when they are not selected for @label2.',
-              array('@label' => t('Minimum components'), '@label2' => t('Components'),
-              '@components' => Html::escape(implode(', ', array($n['title'], $n['generational'], $n['credentials']))))),
+              ['@label' => t('Minimum components'), '@label2' => t('Components'),
+              '@components' => Html::escape(implode(', ', [$n['title'], $n['generational'], $n['credentials']]))]),
       */
       t('Maximum length for @field must be higher than or equal to 1.', ['@field' => $n['title']]),
       t('Maximum length for @field must be higher than or equal to 1.', ['@field' => $n['given']]),

 

  • Alan D. committed dc34d2e on 8.x-1.x authored by nkoporec
    Issue #2971011 by nkoporec, Alan D.: Convert module to use short array...
alan d.’s picture

Priority: Normal » Minor
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.