diff --git a/core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php b/core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php
index 0e5f721375..25b65318e1 100644
--- a/core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php
+++ b/core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php
@@ -47,9 +47,9 @@ public function _contextual_links_id_testcases() {
       'links' => [
         'foo' => [
           'route_parameters' => [
-            'bar',
+            0 => 'bar',
             'key' => 'baz',
-            'qux',
+            1 => 'qux',
           ],
           'metadata' => ['langcode' => 'en'],
         ],
@@ -90,9 +90,9 @@ public function _contextual_links_id_testcases() {
         ],
         'foo' => [
           'route_parameters' => [
-            'bar',
+            0 => 'bar',
             'key' => 'baz',
-            'qux',
+            1 => 'qux',
           ],
           'metadata' => ['langcode' => 'en'],
         ],
diff --git a/core/modules/language/language.admin.inc b/core/modules/language/language.admin.inc
index a55e65a23c..4435dcea87 100644
--- a/core/modules/language/language.admin.inc
+++ b/core/modules/language/language.admin.inc
@@ -55,7 +55,7 @@ function template_preprocess_language_negotiation_configure_form(&$variables) {
 
         $table[$id]['title'] = [
           '#prefix' => '<strong>',
-          $form[$type]['title'][$id],
+          0 => $form[$type]['title'][$id],
           '#suffix' => '</strong>',
         ];
         $table[$id]['description'] = $form[$type]['description'][$id];
diff --git a/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php b/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php
index 5e38c1d888..ee3e2172c0 100644
--- a/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php
+++ b/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php
@@ -148,7 +148,7 @@ public function providerTestBlocks() {
           'label_selector' => 'h2',
           'button_text' => 'Save Powered by Drupal',
           'toolbar_item' => '#toolbar-item-user',
-          NULL,
+          0 => NULL,
         ],
         "$theme: block-branding" => [
           'theme' => $theme,
@@ -168,7 +168,7 @@ public function providerTestBlocks() {
           'label_selector' => 'h2',
           'button_text' => 'Save Search form',
           'toolbar_item' => NULL,
-          NULL,
+          0 => NULL,
         ],
         // This is the functional JS test coverage accompanying
         // \Drupal\Tests\settings_tray\Functional\SettingsTrayTest::testPossibleAnnotations().
@@ -180,7 +180,7 @@ public function providerTestBlocks() {
           'label_selector' => NULL,
           'button_text' => NULL,
           'toolbar_item' => NULL,
-          NULL,
+          0 => NULL,
         ],
         // This is the functional JS test coverage accompanying
         // \Drupal\Tests\settings_tray\Functional\SettingsTrayTest::testPossibleAnnotations().
@@ -192,7 +192,7 @@ public function providerTestBlocks() {
           'label_selector' => NULL,
           'button_text' => NULL,
           'toolbar_item' => NULL,
-          NULL,
+          0 => NULL,
         ],
       ];
     }
diff --git a/core/modules/system/src/Tests/Theme/FunctionsTest.php b/core/modules/system/src/Tests/Theme/FunctionsTest.php
index 6cc28fef17..a556e0f7b9 100644
--- a/core/modules/system/src/Tests/Theme/FunctionsTest.php
+++ b/core/modules/system/src/Tests/Theme/FunctionsTest.php
@@ -108,7 +108,7 @@ public function testItemList() {
         '#markup' => 'c',
         'childlist' => [
           '#attributes' => ['id' => 'clist'],
-          'ca',
+          0 => 'ca',
           [
             '#markup' => 'cb',
             '#wrapper_attributes' => ['class' => ['item-class-cb']],
@@ -117,7 +117,7 @@ public function testItemList() {
               'cbb',
             ],
           ],
-          'cc',
+          1 => 'cc',
         ],
       ],
       // Use #markup to be able to specify #wrapper_attributes.
diff --git a/core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php b/core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php
index a4fbb667ba..68b6a5e12b 100644
--- a/core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php
+++ b/core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php
@@ -25,8 +25,8 @@ protected function setUp() {
 
   public function _getFakeModuleFiles() {
     $files = [
-      'fake.module',
-      'fake.info.yml',
+      0 => 'fake.module',
+      1 => 'fake.info.yml',
       'theme' => [
         'fake.html.twig',
       ],
diff --git a/core/modules/views/tests/src/Unit/PluginBaseTest.php b/core/modules/views/tests/src/Unit/PluginBaseTest.php
index afa849f8c8..1a3f9fb0bf 100644
--- a/core/modules/views/tests/src/Unit/PluginBaseTest.php
+++ b/core/modules/views/tests/src/Unit/PluginBaseTest.php
@@ -101,7 +101,7 @@ public function providerTestUnpackOptions() {
       'expected' => [
         'key' => 'value2',
       ],
-      '',
+      0 => '',
     ];
     // Set no storage but an options value, so the options value should be kept.
     $test_parameters[] = [
diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist
index 30118447d5..90dc1b7bfb 100644
--- a/core/phpcs.xml.dist
+++ b/core/phpcs.xml.dist
@@ -226,10 +226,7 @@
 
   <!-- Squiz sniffs -->
   <rule ref="Squiz.Arrays.ArrayBracketSpacing"/>
-  <rule ref="Squiz.Arrays.ArrayDeclaration">
-    <exclude name="Squiz.Arrays.ArrayDeclaration.NoKeySpecified"/>
-    <exclude name="Squiz.Arrays.ArrayDeclaration.KeySpecified"/>
-  </rule>
+  <rule ref="Squiz.Arrays.ArrayDeclaration" />
   <!-- Disable some error messages that we do not want. -->
   <rule ref="Squiz.Arrays.ArrayDeclaration.CloseBraceNotAligned">
     <severity>0</severity>
diff --git a/core/tests/Drupal/Tests/Component/Serialization/YamlTestBase.php b/core/tests/Drupal/Tests/Component/Serialization/YamlTestBase.php
index 82226d0d34..e3e8de9be0 100644
--- a/core/tests/Drupal/Tests/Component/Serialization/YamlTestBase.php
+++ b/core/tests/Drupal/Tests/Component/Serialization/YamlTestBase.php
@@ -21,7 +21,7 @@ public function providerEncodeDecodeTests() {
         'how' => [
           'about' => 'if',
           'i' => 'ask',
-          'nicely',
+          0 => 'nicely',
         ],
         'the' => [
           'answer' => [
@@ -31,11 +31,11 @@ public function providerEncodeDecodeTests() {
         ],
         'how_many_times' => 123,
         'should_i_ask' => FALSE,
-        1,
-        FALSE,
-        [1, FALSE],
-        [10],
-        [0 => '123456'],
+        0 => 1,
+        1 => FALSE,
+        2 => [1, FALSE],
+        3 => [10],
+        4 => [0 => '123456'],
       ],
       [NULL],
     ];
diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php
index c5d4c1c4ea..f730ba8add 100644
--- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php
@@ -145,7 +145,7 @@ public function providerGetPropertiesToExport() {
     $data[] = [
       [
         'config_export' => [
-          'id',
+          0 => 'id',
           'custom_property' => 'customProperty',
         ],
       ],
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererTest.php b/core/tests/Drupal/Tests/Core/Render/RendererTest.php
index 54037c57e9..ad6149c13d 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererTest.php
@@ -321,7 +321,7 @@ public function providerTestRenderBasic() {
         'container' => [
           '#attributes' => ['class' => ['bar']],
         ],
-        'container',
+        0 => 'container',
       ],
     ];
     $setup_code = function () {
