- Issue created by @quietone
- Status changed to Needs review
6 months ago 12:11pm 12 June 2024 - Status changed to RTBC
6 months ago 1:54pm 12 June 2024 - πΊπΈUnited States smustgrave
List is getting easier to review :)
With the MR still applied from π Fix Drupal.Commenting.DocCommentLongArraySyntax coding standard Needs work
Ran grep -r "\barray(" * | grep -F \* | grep -v "vendor" | grep -v "node_modules"
and got
lib/Drupal/Core/Database/Database.php: * array( lib/Drupal/Core/Database/Log.php: * array( lib/Drupal/Core/Database/Log.php: * $logging_key = array( lib/Drupal/Core/Database/Log.php: * array('query' => '', 'args' => array(), 'caller' => '', 'target' => '', 'time' => 0, 'start' => 0), lib/Drupal/Core/Database/Log.php: * array('query' => '', 'args' => array(), 'caller' => '', 'target' => '', 'time' => 0, 'start' => 0), lib/Drupal/Core/Database/Query/Select.php: * array( lib/Drupal/Core/Cache/UseCacheBackendTrait.php: * tags. For example, ['node' => array(123), 'user' => array(92)]. lib/Drupal/Core/Datetime/DrupalDateTime.php: * DrupalDateTime::createFromArray( array('year' => 2010, 'month' => 9, 'day' => 28) ) lib/Drupal/Component/Gettext/PoHeader.php: * array( lib/Drupal/Component/Gettext/PoHeader.php: * array( lib/Drupal/Component/Gettext/PoHeader.php: * array( modules/views_ui/admin.inc: * array('dynamic_content', 'section') for this parameter. modules/system/tests/modules/common_test/common_test.module: * \Drupal::moduleHandler()->alter(array(TYPE1, TYPE2), ...) allows scripts/dump-database-d7.sh: $result = db_query('SELECT * FROM {'. $table .'}', array(), array('fetch' => PDO::FETCH_ASSOC));
All these appear to be blocks vs inline so assuming the last one will clean these up.
- Status changed to Needs work
6 months ago 1:57pm 12 June 2024 - πΊπΈUnited States smustgrave
Actually after applying the MR from π Convert code blocks in comments using array() syntax to @code/@endcode Needs review and ran the grep again think this one missed a few
lib/Drupal/Core/Cache/UseCacheBackendTrait.php:
modules/views_ui/admin.inc:
modules/system/tests/modules/common_test/common_test.module: (Could maybe go in the other one) - π³πΏNew Zealand quietone
@smustgrave, no worries. I was using the search in PHPStorm and was filtering on .php files. Though, that doesn't explain how I missed UseCacheBackendTrait.php.
#5. Those were all in sentences so I added them here.
- Status changed to Needs review
6 months ago 2:33am 13 June 2024 - Status changed to RTBC
6 months ago 2:16pm 13 June 2024 - πΊπΈUnited States smustgrave
Additional items appear to be addressed now. So believe with the combo of the 3 these are complete.
- Status changed to Needs work
6 months ago 5:57pm 17 June 2024 - πΊπΈUnited States xjm
Similarly to π Convert code blocks in comments using array() syntax to @code/@endcode Needs review , we're missing an equivalent PHPCS rule to the one from π Fix Drupal.Commenting.DocCommentLongArraySyntax coding standard Needs work for these. We need a followup for that in the appropriate queue.
I'd be fine to treat the rule as either blocker or followup since the scope is really small, but we do need the rule.
- Status changed to Needs review
2 months ago 4:12am 26 September 2024 - π³πΏNew Zealand quietone
I prefer treating the rule as a followup. It is unlikely that more instances will creep in.
π Add a rule for detect long array syntax in sentences. Active
- π«π·France nod_ Lille
There seem to be a couple missing (outside of @code/@endcode blocks):
core\lib\Drupal\Core\Extension (1 usage found) ModuleHandler.php (1 usage found) 405 // specific variants of it, as in the case of array('form', 'form_FORM_ID'). core\lib\Drupal\Core\Form FormState.php 1288 // self::getValue(array('foo', 'bar')), which is the level where we core\lib\Drupal\Core\Theme (1 usage found) ThemeManager.php (1 usage found) 427 // specific variants of it, as in the case of array('form', 'form_FORM_ID'). core\modules\file\tests\src\Functional (1 usage found) FileFieldWidgetTest.php (1 usage found) 163 // iteration, so array(1, 1, 0) means: core\modules\file\tests\src\FunctionalJavascript (1 usage found) FileFieldWidgetTest.php (1 usage found) 96 // iteration, so array(1, 1, 0) means: core\modules\locale (1 usage found) locale.bulk.inc (1 usage found) 208 // Update the seek and the number of items in the $options array(). core\modules\node\src\Plugin\Search (1 usage found) NodeSearch.php (1 usage found) 277 // array('type:page', 'term:27', 'term:13', 'langcode:en'); core\modules\sqlite\src\Driver\Database\sqlite (1 usage found) Schema.php (1 usage found) 659 // The key definition can be an array($field, $length). core\modules\system\tests\modules\common_test (1 usage found) common_test.module (1 usage found) 96 // \Drupal::moduleHandler()->alter(array('drupal_alter', 'drupal_alter_foo'), ...), core\modules\taxonomy\src\Plugin\views\filter (1 usage found) TaxonomyIndexTid.php (1 usage found) 252 // Due to #1464174 there is a chance that array('') was saved in the admin ui. core\modules\views_ui\tests\src\Functional (1 usage found) core\tests\Drupal\KernelTests\Core\Entity (1 usage found) EntityFieldTest.php (1 usage found) 252 // Test emptying a field by assigning an empty value. NULL and array() core\tests\Drupal\Tests\Component\ProxyBuilder (3 usages found) ProxyBuilderTest.php (3 usages found) 127 // @todo Solve the silly linebreak for array() 152 // @todo Solve the silly linebreak for array() 177 // @todo Solve the silly linebreak for array() core\tests\Drupal\Tests\Component\Utility (1 usage found) ColorTest.php (1 usage found) 166 // Input using indexed RGB array (e.g.: array(10, 10, 10)). core\tests\Drupal\Tests\Core\Batch (1 usage found) PercentagesTest.php (1 usage found) 39 // array(total, current, expected). core\tests\Drupal\Tests\Core\ProxyBuilder (1 usage found) ProxyBuilderTest.php (1 usage found) 42 // @todo Solve the silly linebreak for array()
not sure how much is in scope but they don't get picked up by the cli
- π³πΏNew Zealand quietone
Thanks nod. I did miss quite a few, sorry about that.
- πΊπΈUnited States smustgrave
All I did was a simple rebase just FYI
Tests appear to be green again, so previously were just random failures.
Feedback appears to be addressed.
The Needs Review Queue Bot β tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide β to find step-by-step guides for working with issues.
- π³πΏNew Zealand quietone
Rebase with a conflict in core/modules/views_ui/admin.inc because of all the hook changes.
- Status changed to RTBC
8 days ago 5:03pm 25 November 2024