Index: plugin/tests/src/Unit/Plugin/Plugin/PluginSelector/AdvancedPluginSelectorBaseTest.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/tests/src/Unit/Plugin/Plugin/PluginSelector/AdvancedPluginSelectorBaseTest.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/tests/src/Unit/Plugin/Plugin/PluginSelector/AdvancedPluginSelectorBaseTest.php	(date 1563533816194)
@@ -80,9 +80,9 @@
   public function testBuildPluginForm() {
     $form_state = $this->getMock(FormStateInterface::class);
 
-    $plugin_form = array(
+    $plugin_form = [
       '#foo' => $this->randomMachineName(),
-    );
+    ];
 
     $plugin = $this->getMockForAbstractClass(AdvancedPluginSelectorBaseUnitTestPluginFormPluginInterface::class);
     $plugin->expects($this->once())
@@ -110,8 +110,6 @@
     $form_state = new FormState();
 
     $plugin = $this->getMock(PluginInspectionInterface::class);
-    $plugin->expects($this->never())
-      ->method('buildConfigurationForm');
 
     $method = new \ReflectionMethod($this->sut, 'buildPluginForm');
     $method->setAccessible(TRUE);
@@ -139,16 +137,17 @@
     $build = $this->sut->buildSelectorForm($form, $form_state);
     unset($build['container']['#plugin_selector_form_state_key']);
 
-    $expected_build = array(
+    $expected_build = [
+      '#tree' => TRUE,
       '#cache' => [
         'contexts' => [],
         'tags' => [],
         'max-age' => Cache::PERMANENT,
       ],
-      'container' => array(
-        '#attributes' => array(
-          'class' => array('plugin-selector-' . Html::getId($this->pluginId)),
-        ),
+      'container' => [
+        '#attributes' => [
+          'class' => ['plugin-selector-' . Html::getId($this->pluginId)],
+        ],
         '#available_plugins' => [],
         '#process' => [
           [
@@ -158,8 +157,8 @@
         ],
         '#tree' => TRUE,
         '#type' => 'container',
-      ),
-    );
+      ],
+    ];
     $this->assertSame($expected_build, $build);
   }
 
@@ -191,16 +190,17 @@
     $build = $this->sut->buildSelectorForm($form, $form_state);
     unset($build['container']['#plugin_selector_form_state_key']);
 
-    $expected_build = array(
+    $expected_build = [
+      '#tree' => TRUE,
       '#cache' => [
         'contexts' => [],
         'tags' => [],
         'max-age' => 0,
       ],
-      'container' => array(
-        '#attributes' => array(
-          'class' => array('plugin-selector-' . Html::getId($this->pluginId)),
-        ),
+      'container' => [
+        '#attributes' => [
+          'class' => ['plugin-selector-' . Html::getId($this->pluginId)],
+        ],
         '#available_plugins' => [$plugin],
         '#process' => [
           [
@@ -210,8 +210,8 @@
         ],
         '#tree' => TRUE,
         '#type' => 'container',
-      ),
-    );
+      ],
+    ];
     $this->assertSame($expected_build, $build);
   }
 
@@ -276,17 +276,18 @@
     $build = $this->sut->buildSelectorForm($form, $form_state);
     unset($build['container']['#plugin_selector_form_state_key']);
 
-    $expected_build = array(
+    $expected_build = [
+      '#tree' => TRUE,
       '#cache' => [
         'contexts' => $cache_contexts,
         'tags' => $cache_tags,
         'max-age' => 0,
       ],
-      'container' => array(
-        '#attributes' => array(
-          'class' => array('plugin-selector-' . Html::getId($this->pluginId)),
-        ),
-        '#available_plugins' => array($plugin_a, $plugin_b),
+      'container' => [
+        '#attributes' => [
+          'class' => ['plugin-selector-' . Html::getId($this->pluginId)],
+        ],
+        '#available_plugins' => [$plugin_a, $plugin_b],
         '#process' => [
           [
             AdvancedPluginSelectorBase::class,
@@ -295,8 +296,8 @@
         ],
         '#tree' => TRUE,
         '#type' => 'container',
-      ),
-    );
+      ],
+    ];
     $this->assertSame($expected_build, $build);
   }
 
@@ -304,14 +305,14 @@
    * @covers ::submitSelectorForm
    */
   public function testSubmitSelectorForm() {
-    $form = array(
-      'container' => array(
-        'plugin_form' => array(
+    $plugin_selector_form = [
+      'container' => [
+        'plugin_form' => [
           $this->randomMachineName() => [],
-        ),
-      ),
-    );
-    $form_state = $this->getMock(FormStateInterface::class);
+        ],
+      ],
+    ];
+    $plugin_selector_form_state = $this->getMock(SubformStateInterface::class);
 
     $plugin = $this->getMockForAbstractClass(AdvancedPluginSelectorBaseUnitTestPluginFormPluginInterface::class);
     $plugin->expects($this->once())
@@ -330,14 +331,15 @@
     $plugin_id_a = $this->randomMachineName();
     $plugin_id_b = $this->randomMachineName();
 
-    $form = array(
-      'container' => array(
-        '#parents' => array('foo', 'bar', 'container'),
-        'plugin_form' => array(
+    $selector_form = [
+      '#parents' => [],
+      'container' => [
+        '#parents' => ['foo', 'bar', 'container'],
+        'plugin_form' => [
           $this->randomMachineName() => [],
-        ),
-      ),
-    );
+        ],
+      ],
+    ];
 
     $plugin_a = $this->getMockForAbstractClass(AdvancedPluginSelectorBaseUnitTestPluginFormPluginInterface::class);
     $plugin_a->expects($this->any())
@@ -350,57 +352,45 @@
       ->method('getPluginId')
       ->willReturn($plugin_id_b);
 
-    $map = array(
-      array($plugin_id_a, [], $plugin_a),
-      array($plugin_id_b, [], $plugin_b),
-    );
+    $map = [
+      [$plugin_id_a, [], $plugin_a],
+      [$plugin_id_b, [], $plugin_b],
+    ];
     $this->selectablePluginManager->expects($this->exactly(2))
       ->method('createInstance')
       ->willReturnMap($map);
 
     // The plugin is set for the first time. The plugin form must not be
     // validated, as there is no input for it yet.
-    $form_state = $this->getMock(FormStateInterface::class);
-    $form_state->expects($this->atLeastOnce())
-      ->method('getValues')
-      ->willReturn(array(
-        'foo' => array(
-          'bar' => array(
-            'container' => array(
-              'select' => array(
-                'container' => array(
-                  'plugin_id' => $plugin_id_a,
-                ),
-              ),
-            ),
-          ),
-        ),
-      ));
-    $form_state->expects($this->once())
-      ->method('setRebuild');
+    $form_state = new FormState();
+    $form_state->setValues([
+      'container' => [
+        'select' => [
+          'container' => [
+            'plugin_id' => $plugin_id_a,
+          ],
+        ],
+      ],
+    ]);
+    $selector_form_state = SubformState::createForSubform($selector_form, $selector_form, $form_state);
+    $this->sut->validateSelectorForm($selector_form, $selector_form_state);
+    $this->assertTrue($selector_form_state->isRebuilding());
     $this->sut->validateSelectorForm($form, $form_state);
     $this->assertSame($plugin_a, $this->sut->getSelectedPlugin());
 
     // The form is validated, but the plugin remains unchanged, and as such
     // should validate its own form as well.
-    $form_state = $this->getMock(FormStateInterface::class);
-    $form_state->expects($this->atLeastOnce())
-      ->method('getValues')
-      ->willReturn(array(
-        'foo' => array(
-          'bar' => array(
-            'container' => array(
-              'select' => array(
-                'container' => array(
-                  'plugin_id' => $plugin_id_a,
-                ),
-              ),
-            ),
-          ),
-        ),
-      ));
-    $form_state->expects($this->never())
-      ->method('setRebuild');
+    $form_state = new FormState();
+    $form_state->setValues([
+      'container' => [
+        'select' => [
+          'container' => [
+            'plugin_id' => $plugin_id_a,
+          ],
+        ],
+      ],
+    ]);
+    $selector_form_state = SubformState::createForSubform($selector_form, $selector_form, $form_state);
     $plugin_a->expects($this->once())
       ->method('validateConfigurationForm')
       ->with($form['container']['plugin_form'], $form_state);
@@ -409,48 +399,35 @@
 
     // The plugin has changed. The plugin form must not be validated, as there
     // is no input for it yet.
-    $form_state = $this->getMock(FormStateInterface::class);
-    $form_state->expects($this->atLeastOnce())
-      ->method('getValues')
-      ->willReturn(array(
-        'foo' => array(
-          'bar' => array(
-            'container' => array(
-              'select' => array(
-                'container' => array(
-                  'plugin_id' => $plugin_id_b,
-                ),
-              ),
-            ),
-          ),
-        ),
-      ));
-    $form_state->expects($this->once())
-      ->method('setRebuild');
-    $this->sut->validateSelectorForm($form, $form_state);
-    $this->assertSame($plugin_b, $this->sut->getSelectedPlugin());
+    $form_state = new FormState();
+    $form_state->setValues([
+      'container' => [
+        'select' => [
+          'container' => [
+            'plugin_id' => $plugin_id_b,
+          ],
+        ],
+      ],
+    ]);
+    $selector_form_state = SubformState::createForSubform($selector_form, $selector_form, $form_state);
+    $this->sut->validateSelectorForm($selector_form, $selector_form_state);
+    $this->assertTrue($selector_form_state->isRebuilding());
 
     // Change the plugin ID back to the original. No new plugin may be
     // instantiated, nor must the plugin form be validated.
-    $form_state = $this->getMock(FormStateInterface::class);
-    $form_state->expects($this->atLeastOnce())
-      ->method('getValues')
-      ->willReturn(array(
-        'foo' => array(
-          'bar' => array(
-            'container' => array(
-              'select' => array(
-                'container' => array(
-                  'plugin_id' => $plugin_id_a,
-                ),
-              ),
-            ),
-          ),
-        ),
-      ));
-    $form_state->expects($this->once())
-      ->method('setRebuild');
-    $this->sut->validateSelectorForm($form, $form_state);
+    $form_state = new FormState();
+    $form_state->setValues([
+      'container' => [
+        'select' => [
+          'container' => [
+            'plugin_id' => $plugin_id_a,
+          ],
+        ],
+      ],
+    ]);
+    $selector_form_state = SubformState::createForSubform($selector_form, $selector_form, $form_state);
+    $this->sut->validateSelectorForm($selector_form, $selector_form_state);
+    $this->assertTrue($selector_form_state->isRebuilding());
     $this->assertSame($plugin_a, $this->sut->getSelectedPlugin());
   }
 
@@ -479,22 +456,22 @@
 
     $this->sut->setLabel($label);
 
-    $expected_build = $element + array(
-        'select' => array(
-          'message' => array(
+    $expected_build = $element + [
+        'select' => [
+          'message' => [
             '#markup' => 'There are no available options.',
             '#title' => $label,
             '#type' => 'item',
-          ),
-          'container' => array(
+          ],
+          'container' => [
             '#type' => 'container',
-            'plugin_id' => array(
+            'plugin_id' => [
               '#type' => 'value',
               '#value' => NULL,
-            ),
-          ),
-        ),
-      );
+            ],
+          ],
+        ],
+      ];
     $this->assertEquals($expected_build, $this->sut->buildNoAvailablePlugins($element, $form_state, $form));
   }
 
@@ -504,9 +481,9 @@
   public function testBuildOneAvailablePlugin() {
     $plugin_id = $this->randomMachineName();
 
-    $plugin_form = array(
-      '#type' => $this->randomMachineName(),
-    );
+    $plugin_form = [
+      '#type' => 'plugin_form',
+    ];
 
     $plugin = $this->getMockForAbstractClass(AdvancedPluginSelectorBaseUnitTestPluginFormPluginInterface::class);
     $plugin->expects($this->atLeastOnce())
@@ -516,9 +493,9 @@
       ->method('buildConfigurationForm')
       ->willReturn($plugin_form);
 
-    $element = array(
-      '#available_plugins' => array($plugin),
-    );
+    $element = [
+      '#available_plugins' => [$plugin],
+    ];
     $form_state = $this->getMock(FormStateInterface::class);
     $form = [];
 
@@ -526,28 +503,6 @@
 
     $this->sut->setLabel($label);
 
-    $expected_build = array(
-      '#available_plugins' => array($plugin),
-      'select' => array(
-        'message' => [
-          '#title' => $label,
-          '#type' => 'item',
-        ],
-        'container' => array(
-          '#type' => 'container',
-          'plugin_id' => array(
-            '#type' => 'value',
-            '#value' => $plugin_id,
-          ),
-        ),
-      ),
-      'plugin_form' => array(
-          '#attributes' => array(
-            'class' => array('plugin-selector-' . Html::getId($this->pluginId) . '-plugin-form'),
-          ),
-          '#type' => 'container',
-        ) + $plugin_form,
-    );
     $build = $this->sut->buildOneAvailablePlugin($element, $form_state, $form);
     unset($build['plugin_form']['#id']);
     $this->assertSame($expected_build, $build);
@@ -559,30 +514,30 @@
   public function testbuildMultipleAvailablePlugins() {
     $plugin = $this->getMock(PluginInspectionInterface::class);
 
-    $element = array(
-      '#available_plugins' => array($plugin),
-    );
+    $element = [
+      '#available_plugins' => [$plugin],
+    ];
     $form_state = $this->getMock(FormStateInterface::class);
     $form = [];
 
-    $plugin_form = array(
+    $plugin_form = [
       '#type' => $this->randomMachineName(),
-    );
+    ];
 
-    $selector = array(
+    $selector = [
       '#type' => $this->randomMachineName(),
-    );
+    ];
 
     /** @var \Drupal\plugin\Plugin\Plugin\PluginSelector\AdvancedPluginSelectorBase|\PHPUnit_Framework_MockObject_MockObject $plugin_selector */
     $plugin_selector = $this->getMockBuilder(AdvancedPluginSelectorBase::class)
-      ->setMethods(array('buildPluginForm', 'buildSelector'))
-      ->setConstructorArgs(array(
+      ->setMethods(['buildPluginForm', 'buildSelector'])
+      ->setConstructorArgs([
         [],
         $this->pluginId,
         $this->pluginDefinition,
         $this->defaultPluginResolver,
         $this->stringTranslation
-      ))
+      ])
       ->getMockForAbstractClass();
     $plugin_selector->setSelectablePluginType($this->selectablePluginType);
     $plugin_selector->expects($this->once())
@@ -591,16 +546,19 @@
       ->willReturn($plugin_form);
     $plugin_selector->expects($this->once())
       ->method('buildSelector')
-      ->with($element, $form_state, array($plugin))
+      ->with($element, $form_state, [$plugin])
       ->willReturn($selector);
     $plugin_selector->setSelectedPlugin($plugin);
 
-    $expected_build = array(
-      '#available_plugins' => array($plugin),
+    $expected_build = [
+      '#available_plugins' => [$plugin],
       'select' => $selector,
       'plugin_form' => $plugin_form,
-    );
-    $this->assertEquals($expected_build, $plugin_selector->buildMultipleAvailablePlugins($element, $form_state, $form));
+    ];
+
+    $method = new \ReflectionMethod(get_class($plugin_selector), 'buildMultipleAvailablePlugins');
+    $method->setAccessible(TRUE);
+    $this->assertEquals($expected_build, $method->invoke($plugin_selector, $element, $form_state, $form));
   }
 
   /**
@@ -630,46 +588,43 @@
     $plugin->expects($this->any())
       ->method('getPluginId')
       ->willReturn($plugin_id);
-    $plugin->expects($this->any())
-      ->method('getPluginLabel')
-      ->willReturn($plugin_label);
 
     $this->sut->setSelectedPlugin($plugin);
 
-    $element = array(
-      '#parents' => array('foo', 'bar'),
-    );
+    $element = [
+      '#parents' => ['foo', 'bar'],
+    ];
     $form_state = $this->getMock(FormStateInterface::class);
-    $available_plugins = array($plugin);
+    $available_plugins = [$plugin];
 
-    $expected_build_change = array(
-      '#ajax' => array(
-        'callback' => array(
+    $expected_build_change = [
+      '#ajax' => [
+        'callback' => [
           AdvancedPluginSelectorBase::class,
           'ajaxRebuildForm'
-        ),
-      ),
-      '#attributes' => array(
-        'class' => array('js-hide')
-      ),
-      '#limit_validation_errors' => array(
-        array(
+        ],
+      ],
+      '#attributes' => [
+        'class' => ['js-hide']
+      ],
+      '#limit_validation_errors' => [
+        [
           'foo',
           'bar',
           'select',
           'plugin_id'
-        )
-      ),
+        ]
+      ],
       '#name' => 'foo__bar__select__container__change',
       '#submit' => [[AdvancedPluginSelectorBase::class, 'rebuildForm']],
       '#type' => 'submit',
       '#value' => 'Choose',
-    );
-    $build = $method->invokeArgs($this->sut, array(
+    ];
+    $build = $method->invokeArgs($this->sut, [
       $element,
       $form_state,
       $available_plugins
-    ));
+    ]);
     $this->assertArrayHasKey('plugin_id', $build['container']);
     $this->assertEquals($expected_build_change, $build['container']['change']);
     $this->assertSame('container', $build['container']['#type']);
Index: plugin/tests/modules/plugin_test_helper/src/AdvancedPluginSelectorBasePluginSelectorForm.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/tests/modules/plugin_test_helper/src/AdvancedPluginSelectorBasePluginSelectorForm.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/tests/modules/plugin_test_helper/src/AdvancedPluginSelectorBasePluginSelectorForm.php	(date 1563533201060)
@@ -82,19 +82,20 @@
     $form['plugin'] = $plugin_selector->buildSelectorForm([], $form_state);
     // Nest the selector in a tree if that's required.
     if ($tree) {
-      $form['tree'] = array(
+      $form['tree'] = [
         '#tree' => TRUE,
-      );
+        'plugin' => $form['plugin'],
+      ];
       $form['tree']['plugin'] = $form['plugin'];
       unset($form['plugin']);
     }
-    $form['actions'] = array(
+    $form['actions'] = [
       '#type' => 'actions',
-    );
-    $form['actions']['submit'] = array(
+    ];
+    $form['actions']['submit'] = [
       '#type' => 'submit',
       '#value' => t('Submit'),
-    );
+    ];
 
     return $form;
   }
Index: plugin/src/Plugin/Plugin/PluginSelector/PluginSelectorBase.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/src/Plugin/Plugin/PluginSelector/PluginSelectorBase.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/src/Plugin/Plugin/PluginSelector/PluginSelectorBase.php	(date 1563533100082)
@@ -100,13 +100,13 @@
    * {@inheritdoc}
    */
   public function defaultConfiguration() {
-    return array(
+    return [
       'description' => NULL,
       'label' => NULL,
       'required' => FALSE,
       'collect_plugin_configuration' => TRUE,
       'keep_previously_selected_plugins' => TRUE,
-    );
+    ];
   }
 
   /**
Index: plugin/src/Plugin/Plugin/PluginSelector/AdvancedPluginSelectorBase.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/src/Plugin/Plugin/PluginSelector/AdvancedPluginSelectorBase.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/src/Plugin/Plugin/PluginSelector/AdvancedPluginSelectorBase.php	(date 1563533100035)
@@ -72,17 +72,17 @@
     }
     $cacheability_metadata->applyTo($form);
 
-    $plugin_selector_form_state_key = static::setPluginSelector($form_state, $this);
-    $form['container'] = array(
-      '#attributes' => array(
-        'class' => array('plugin-selector-' . Html::getClass($this->getPluginId())),
-      ),
+    $plugin_selector_form_state_key = static::setPluginSelector($plugin_selector_form_state, $this);
+    $plugin_selector_form['container'] = [
+      '#attributes' => [
+        'class' => ['plugin-selector-' . Html::getClass($this->getPluginId())],
+      ],
       '#available_plugins' => $available_plugins,
       '#plugin_selector_form_state_key' => $plugin_selector_form_state_key,
       '#process' => [[get_class(), 'processBuildSelectorForm']],
       '#tree' => TRUE,
       '#type' => 'container',
-    );
+    ];
 
     return $form;
   }
@@ -213,13 +213,13 @@
    *
    * @return array
    */
-  protected function buildPluginForm(FormStateInterface $form_state) {
-    $element = array(
-      '#attributes' => array(
+  protected function buildPluginForm(array $plugin_selector_form, FormStateInterface $plugin_selector_form_state) {
+    $selected_plugin_form = [
+      '#attributes' => [
         'class' => [Html::getClass(sprintf('plugin-selector-%s-plugin-form', $this->getPluginId()))],
-      ),
+      ],
       '#type' => 'container',
-    );
+    ];
 
     $selectedPlugin = $this->getSelectedPlugin();
     if ($this->getCollectPluginConfiguration() && $selectedPlugin instanceof PluginFormInterface) {
@@ -232,19 +232,19 @@
   /**
    * Builds the form elements for when there are no available plugins.
    */
-  public function buildNoAvailablePlugins(array $element, FormStateInterface $form_state) {
-    $element['select']['container'] = array(
+  public function buildNoAvailablePlugins(array $element, FormStateInterface $plugin_selector_form_state) {
+    $element['select']['container'] = [
       '#type' => 'container',
-    );
-    $element['select']['container']['plugin_id'] = array(
+    ];
+    $element['select']['container']['plugin_id'] = [
       '#type' => 'value',
       '#value' => NULL,
-    );
-    $element['select']['message'] = array(
+    ];
+    $element['select']['message'] = [
       '#markup' => $this->t('There are no available options.'),
       '#title' => $this->getLabel(),
       '#type' => 'item',
-    );
+    ];
 
     return $element;
   }
@@ -261,18 +261,18 @@
       $this->setSelectedPlugin($plugin);
     }
 
-    $element['select']['message'] = array(
+    $plugin_selector_form['select']['message'] = [
       '#title' => $this->getLabel(),
       '#type' => 'item',
-    );
-    $element['select']['container'] = array(
+    ];
+    $plugin_selector_form['select']['container'] = [
       '#type' => 'container',
-    );
-    $element['select']['container']['plugin_id'] = array(
+    ];
+    $plugin_selector_form['select']['container']['plugin_id'] = [
       '#type' => 'value',
       '#value' => $this->getSelectedPlugin()->getPluginId(),
-    );
-    $element['plugin_form'] = $this->buildPluginForm($form_state);
+    ];
+    $plugin_selector_form['plugin_form'] = $this->buildPluginForm($plugin_selector_form, $plugin_selector_form_state);
 
     return $element;
   }
@@ -302,36 +302,36 @@
    * @return array
    *   The selector's form elements.
    */
-  protected function buildSelector(array $root_element, FormStateInterface $form_state, array $plugins) {
-    $build['container'] = array(
-      '#attributes' => array(
-        'class' => array('plugin-selector-' . Html::getClass($this->getPluginId() . '-selector')),
-      ),
+  protected function buildSelector(array $plugin_selector_form, FormStateInterface $plugin_selector_form_state, array $plugins) {
+    $build['container'] = [
+      '#attributes' => [
+        'class' => ['plugin-selector-' . Html::getClass($this->getPluginId() . '-selector')],
+      ],
       '#type' => 'container',
-    );
-    $build['container']['plugin_id'] = array(
+    ];
+    $build['container']['plugin_id'] = [
       '#markup' => 'This element must be overridden to provide the plugin ID.',
-    );
-    $root_element_parents = $root_element['#parents'];
+    ];
+    $root_element_parents = $plugin_selector_form['#parents'];
     // Compute the button's name based on its position in the form, but we
     // cannot use "][" to indicate nesting as we would usually do, because then
     // \Drupal\Core\Form\FormBuilder::buttonWasClicked() cannot recognize the
     // button when it is clicked.
     $change_button_name_parts = array_merge($root_element_parents, ['select', 'container', 'change']);
     $change_button_name = implode('__', $change_button_name_parts);
-    $build['container']['change'] = array(
-      '#ajax' => array(
-        'callback' => array(get_class(), 'ajaxRebuildForm'),
-      ),
-      '#attributes' => array(
-        'class' => array('js-hide')
-      ),
-      '#limit_validation_errors' => array(array_merge($root_element['#parents'], array('select', 'plugin_id'))),
+    $build['container']['change'] = [
+      '#ajax' => [
+        'callback' => [get_class(), 'ajaxRebuildForm'],
+      ],
+      '#attributes' => [
+        'class' => ['js-hide']
+      ],
+      '#limit_validation_errors' => array(array_merge($plugin_selector_form['#parents'], array('select', 'plugin_id'))),
       '#name' => $change_button_name,
       '#submit' => array(array(get_class(), 'rebuildForm')),
       '#type' => 'submit',
       '#value' => $this->t('Choose'),
-    );
+    ];
 
     return $build;
   }
Index: plugin/src/Plugin/Plugin/PluginSelector/Radios.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/src/Plugin/Plugin/PluginSelector/Radios.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/src/Plugin/Plugin/PluginSelector/Radios.php	(date 1563533139452)
@@ -18,13 +18,13 @@
   /**
    * {@inheritdoc}
    */
-  public function buildSelectorForm(array $form, FormStateInterface $form_state) {
-    $form = parent::buildSelectorForm($form, $form_state);
-    $form['clear'] = array(
+  public function buildSelectorForm(array $plugin_selector_form, FormStateInterface $plugin_selector_form_state) {
+    $this->assertSubformState($plugin_selector_form_state);
+    $plugin_selector_form = parent::buildSelectorForm($plugin_selector_form, $plugin_selector_form_state);
+    $plugin_selector_form['clear'] = [
       '#markup' => '<div style="clear: both;"></div>',
-    );
-
-    return $form;
+    ];
+    return $plugin_selector_form;
   }
 
   /**
@@ -39,16 +39,16 @@
       $plugin_options[$plugin->getPluginId()] = $plugin_definition instanceof PluginLabelDefinitionInterface ? $plugin_definition->getLabel() : $plugin_definition->getId();
     }
     natcasesort($plugin_options);
-    $element['container']['plugin_id'] = array(
-      '#ajax' => array(
-        'callback' => array(get_class(), 'ajaxRebuildForm'),
+    $element['container']['plugin_id'] = [
+      '#ajax' => [
+        'callback' => [get_class(), 'ajaxRebuildForm'],
         'effect' => 'fade',
         'event' => 'change',
         'progress' => 'none',
-        'trigger_as' => array(
+        'trigger_as' => [
           'name' => $element['container']['change']['#name'],
-        ),
-      ),
+        ],
+      ],
       '#attached' => [
         'library' => ['plugin/plugin_selector.plugin_radios'],
       ],
@@ -59,7 +59,7 @@
       '#title' => $this->getlabel(),
       '#description' => $this->getDescription(),
       '#type' => 'radios',
-    );
+    ];
 
     return $element;
   }
Index: plugin/tests/src/Functional/Plugin/Plugin/PluginSelector/RadiosTest.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/tests/src/Functional/Plugin/Plugin/PluginSelector/RadiosTest.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/tests/src/Functional/Plugin/Plugin/PluginSelector/RadiosTest.php	(date 1563533201106)
@@ -14,7 +14,7 @@
   /**
    * {@inheritdoc}
    */
-  public static $modules = array('filter', 'plugin_test_helper');
+  public static $modules = ['filter', 'plugin_test_helper'];
 
   /**
    * Tests the element.
@@ -65,26 +65,26 @@
     $this->assertNoText(t('There are no available options.'));
 
     // Choose a plugin.
-    $this->drupalPostForm(NULL, array(
+    $this->drupalPostForm(NULL, [
       $name_prefix . '[select][container][plugin_id]' => 'plugin_test_helper_plugin',
-    ), t('Choose'));
+    ], t('Choose'));
     $this->assertFieldByName($name_prefix . '[select][container][plugin_id]');
     $this->assertNotEmpty($this->getSession()->getDriver()->find(sprintf('//input[@name="%s"]', $change_button_name)));
 
     // Change the plugin.
-    $this->drupalPostForm(NULL, array(
+    $this->drupalPostForm(NULL, [
       $name_prefix . '[select][container][plugin_id]' => 'plugin_test_helper_configurable_plugin',
-    ), t('Choose'));
+    ], t('Choose'));
     $this->assertFieldByName($name_prefix . '[select][container][plugin_id]');
     $this->assertNotEmpty($this->getSession()->getDriver()->find(sprintf('//input[@name="%s"]', $change_button_name)));
 
     // Submit the form.
     $foo = $this->randomString();
-    $this->drupalPostForm(NULL, array(
+    $this->drupalPostForm(NULL, [
       $name_prefix . '[select][container][plugin_id]' => 'plugin_test_helper_configurable_plugin',
       $name_prefix . '[plugin_form][foo]' => $foo,
 
-    ), t('Submit'));
+    ], t('Submit'));
 
     $state = \Drupal::state();
     /** @var \Drupal\Component\Plugin\PluginInspectionInterface|\Drupal\Component\Plugin\ConfigurablePluginInterface $selected_plugin */
Index: plugin/tests/src/Functional/Plugin/Plugin/PluginSelector/SelectListTest.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/tests/src/Functional/Plugin/Plugin/PluginSelector/SelectListTest.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/tests/src/Functional/Plugin/Plugin/PluginSelector/SelectListTest.php	(date 1563533201124)
@@ -14,7 +14,7 @@
   /**
    * {@inheritdoc}
    */
-  public static $modules = array('filter', 'plugin_test_helper');
+  public static $modules = ['filter', 'plugin_test_helper'];
 
   /**
    * Tests the element.
@@ -60,26 +60,26 @@
     $this->assertNoText(t('There are no available options.'));
 
     // Choose a plugin.
-    $this->drupalPostForm(NULL, array(
+    $this->drupalPostForm(NULL, [
       $name_prefix . '[select][container][plugin_id]' => 'plugin_test_helper_plugin',
-    ), t('Choose'));
+    ], t('Choose'));
     $this->assertFieldByName($name_prefix . '[select][container][plugin_id]');
     $this->assertNotEmpty($this->getSession()->getDriver()->find(sprintf('//input[@name="%s"]', $change_button_name)));
 
     // Change the plugin.
-    $this->drupalPostForm(NULL, array(
+    $this->drupalPostForm(NULL, [
       $name_prefix . '[select][container][plugin_id]' => 'plugin_test_helper_configurable_plugin',
-    ), t('Choose'));
+    ], t('Choose'));
     $this->assertFieldByName($name_prefix . '[select][container][plugin_id]');
     $this->assertNotEmpty($this->getSession()->getDriver()->find(sprintf('//input[@name="%s"]', $change_button_name)));
 
     // Submit the form.
     $foo = $this->randomString();
-    $this->drupalPostForm(NULL, array(
+    $this->drupalPostForm(NULL, [
       $name_prefix . '[select][container][plugin_id]' => 'plugin_test_helper_configurable_plugin',
       $name_prefix . '[plugin_form][foo]' => $foo,
 
-    ), t('Submit'));
+    ], t('Submit'));
 
     $state = \Drupal::state();
     /** @var \Drupal\Component\Plugin\PluginInspectionInterface|\Drupal\Component\Plugin\ConfigurablePluginInterface $selected_plugin */
Index: plugin/src/Tests/Plugin/Field/FieldWidget/PluginSelectorTest.php
===================================================================
--- plugin/src/Tests/Plugin/Field/FieldWidget/PluginSelectorTest.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/src/Tests/Plugin/Field/FieldWidget/PluginSelectorTest.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
@@ -1,67 +0,0 @@
-<?php
-
-namespace Drupal\plugin\Tests\Plugin\Field\FieldWidget;
-
-use Drupal\field\Entity\FieldConfig;
-use Drupal\field\Entity\FieldStorageConfig;
-use Drupal\simpletest\WebTestBase;
-
-/**
- * \Drupal\plugin\Plugin\Field\FieldWidget\PluginSelector integration test.
- *
- * @group Plugin
- */
-class PluginSelectorTest extends WebTestBase {
-
-  /**
-   * {@inheritdoc}
-   */
-  public static $modules = ['block', 'field_ui', 'plugin'];
-
-  /**
-   * Tests the widget.
-   */
-  protected function testWidget() {
-    $user = $this->drupalCreateUser(['administer user fields']);
-    $this->drupalLogin($user);
-
-    // Test the widget when setting a default field value.
-    $field_name = strtolower($this->randomMachineName());
-    $selectable_plugin_type_id = 'block';
-    $field_type = 'plugin:' . $selectable_plugin_type_id;
-    $default_selected_plugin_id = 'broken';
-    $this->drupalPostForm('admin/config/people/accounts/fields/add-field', [
-      'label' => $this->randomString(),
-      'field_name' => $field_name,
-      'new_storage_type' => $field_type,
-    ], t('Save and continue'));
-    $this->drupalPostForm(NULL, [], t('Save field settings'));
-    $this->drupalPostForm(NULL, [
-      sprintf('default_value_input[field_%s][0][plugin_selector][container][select][container][plugin_id]', $field_name) => $default_selected_plugin_id,
-    ], t('Choose'));
-    $this->drupalPostForm(NULL, [], t('Save settings'));
-    \Drupal::entityManager()->clearCachedFieldDefinitions();
-    // Get all plugin fields.
-    $field_storage_id = 'user.field_' . $field_name;
-    $field_storage = FieldStorageConfig::load($field_storage_id);
-    $this->assertNotNull($field_storage);
-    $field_id = 'user.user.field_' . $field_name;
-    /** @var \Drupal\field\FieldConfigInterface $field */
-    $field = FieldConfig::load($field_id);
-    $this->assertNotNull($field);
-    $this->assertEqual($field->getDefaultValueLiteral()[0]['plugin_id'], $default_selected_plugin_id);
-    $this->assertTrue(is_array($field->getDefaultValueLiteral()[0]['plugin_configuration']));
-
-    // Test the widget when creating an entity.
-    $entity_selected_plugin_id = 'system_breadcrumb_block';
-    $this->drupalPostForm('user/' . $user->id() . '/edit', [
-      sprintf('field_%s[0][plugin_selector][container][select][container][plugin_id]', $field_name) => $entity_selected_plugin_id,
-    ], t('Choose'));
-    $this->drupalPostForm(NULL, [], t('Save'));
-
-    // Test whether the widget displays field values.
-    /** @var \Drupal\Core\Entity\ContentEntityInterface $user */
-    $user = entity_load_unchanged('user', $user->id());
-    $this->assertEqual($user->get('field_' . $field_name)->get(0)->get('plugin_id')->getValue(), $entity_selected_plugin_id);
-  }
-}
Index: plugin/src/Tests/HookUpdateNTest.php
===================================================================
--- plugin/src/Tests/HookUpdateNTest.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/src/Tests/HookUpdateNTest.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
@@ -1,67 +0,0 @@
-<?php
-
-namespace Drupal\plugin\Tests;
-
-use Drupal\system\Tests\Update\UpdatePathTestBase;
-
-/**
- * Tests hook_update_N() implementations.
- *
- * @group Plugin
- */
-class HookUpdateNTest extends UpdatePathTestBase {
-
-  /**
-   * The config factory.
-   *
-   * @var \Drupal\Core\Config\ConfigFactoryInterface
-   */
-  protected $configFactory;
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function setUp() {
-    parent::setUp();
-    $this->configFactory = $this->container->get('config.factory');
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function setDatabaseDumpFiles() {
-    $this->databaseDumpFiles = [
-      realpath(DRUPAL_ROOT . '/core/modules/system/tests/fixtures/update/drupal-8.bare.standard.php.gz'),
-      realpath(__DIR__ . '/../../tests/fixtures/module_installation/database_dump.php'),
-      realpath(__DIR__ . '/../../tests/fixtures/plugin_update_8001/database_dump.php'),
-    ];
-  }
-
-  /**
-   * Tests plugin_update_8001().
-   *
-   * @see plugin_update_8001()
-   */
-  public function testPluginUpdate8001() {
-    $this->runUpdates();
-
-    // Test the integrity of the plugin selector fields.
-    /** @var string[] $fields Keys are config names, and values are matching plugin configuration schema IDs */
-    $fields = [
-      'field.field.user.user.field_plugin_selector' => 'plugin.plugin_configuration.plugin_selector.plugin_select_list',
-      'field.field.user.user.field_plugin_test_helper_mock' => 'plugin_test_helper.plugin_configuration.plugin_test_helper_mock.plugin_test_helper_configurable_plugin',
-    ];
-    foreach ($fields as $config_name => $plugin_config_schema_id) {
-      $config = $this->configFactory->get($config_name)->get();
-      foreach ($config['default_value'] as $default_value) {
-        // Confirm that the "plugin_type_id" property has been removed.
-        $this->assertFalse(array_key_exists('plugin_type_id', $default_value));
-        // Confirm that the "plugin_configuration_schema_id" property exists and
-        // has been populated.
-        $this->assertTrue(array_key_exists('plugin_configuration_schema_id', $default_value));
-        $this->assertEqual($default_value['plugin_configuration_schema_id'], $plugin_config_schema_id);
-      }
-    }
-  }
-
-}
Index: plugin/tests/modules/plugin_test_pcf/plugin_test_pcf.info.yml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/tests/modules/plugin_test_pcf/plugin_test_pcf.info.yml	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/tests/modules/plugin_test_pcf/plugin_test_pcf.info.yml	(date 1563199111575)
@@ -2,14 +2,14 @@
 # core: 8.x
 type: module
 dependencies:
-  - node
-  - plugin
-  - plugin_test_helper
-  - views
+  - drupal:node
+  - plugin:plugin
+  - plugin:plugin_test_helper
+  - drupal:views
 hidden: true
 
-# Information added by Drupal.org packaging script on 2017-04-07
-version: '8.x-2.5'
+# Information added by Drupal.org packaging script on 2019-05-19
+version: '8.x-2.6'
 core: '8.x'
 project: 'plugin'
-datestamp: 1491597185
+datestamp: 1558296185
Index: plugin/tests/src/Unit/Plugin/views/filter/PluginIdTest.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/tests/src/Unit/Plugin/views/filter/PluginIdTest.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/tests/src/Unit/Plugin/views/filter/PluginIdTest.php	(date 1563199111653)
@@ -5,6 +5,7 @@
 use Drupal\Component\Plugin\PluginManagerInterface;
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Cache\CacheableDependencyInterface;
+use Drupal\Core\Cache\Context\CacheContextsManager;
 use Drupal\plugin\Plugin\views\filter\PluginId;
 use Drupal\plugin\PluginDefinition\PluginDefinitionInterface;
 use Drupal\plugin\PluginDefinition\PluginLabelDefinitionInterface;
@@ -86,6 +87,11 @@
   public function testCacheContexts() {
     $plugin_manager_cache_contexts = ['dog', 'ball'];
 
+    $container = $this->prophesize(ContainerInterface::class);
+    $cache_contexts_manager = new CacheContextsManager($container->reveal(), []);
+    $container->get('cache_contexts_manager')->willReturn($cache_contexts_manager);
+    \Drupal::setContainer($container->reveal());
+
     $plugin_manager = $this->prophesize(CacheableDependencyPluginManagerInterface::class);
     $plugin_manager->getCacheContexts()->willReturn($plugin_manager_cache_contexts);
     $plugin_manager->getCacheTags()->willReturn([]);
Index: plugin/tests/modules/plugin_test_mvpbf/plugin_test_mvpbf.info.yml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/tests/modules/plugin_test_mvpbf/plugin_test_mvpbf.info.yml	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/tests/modules/plugin_test_mvpbf/plugin_test_mvpbf.info.yml	(date 1563199111561)
@@ -2,13 +2,13 @@
 # core: 8.x
 type: module
 dependencies:
-  - plugin
-  - plugin_test_helper
-  - views
+  - plugin:plugin
+  - plugin:plugin_test_helper
+  - drupal:views
 hidden: true
 
-# Information added by Drupal.org packaging script on 2017-04-07
-version: '8.x-2.5'
+# Information added by Drupal.org packaging script on 2019-05-19
+version: '8.x-2.6'
 core: '8.x'
 project: 'plugin'
-datestamp: 1491597185
+datestamp: 1558296185
Index: plugin/tests/src/Unit/Plugin/Plugin/PluginSelector/PluginSelectorManagerTest.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/tests/src/Unit/Plugin/Plugin/PluginSelector/PluginSelectorManagerTest.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/tests/src/Unit/Plugin/Plugin/PluginSelector/PluginSelectorManagerTest.php	(date 1563199111645)
@@ -89,7 +89,7 @@
    */
   public function testGetFallbackPluginId() {
     $plugin_id = $this->randomMachineName();
-    $plugin_configuration = array($this->randomMachineName());
+    $plugin_configuration = [$this->randomMachineName()];
     $this->assertInternalType('string', $this->sut->getFallbackPluginId($plugin_id, $plugin_configuration));
   }
 
@@ -97,11 +97,11 @@
    * @covers ::getDefinitions
    */
   public function testGetDefinitions() {
-    $definitions = array(
-      'foo' => array(
+    $definitions = [
+      'foo' => [
         'label' => $this->randomMachineName(),
-      ),
-    );
+      ],
+    ];
     $this->discovery->expects($this->once())
       ->method('getDefinitions')
       ->willReturn($definitions);
Index: plugin/tests/modules/plugin_test_mvpbf/src/Entity/MultiValuePluginBaseField.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/tests/modules/plugin_test_mvpbf/src/Entity/MultiValuePluginBaseField.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/tests/modules/plugin_test_mvpbf/src/Entity/MultiValuePluginBaseField.php	(date 1563199111564)
@@ -33,10 +33,10 @@
     $fields = parent::baseFieldDefinitions($entity_type);
     $fields['plugin'] = BaseFieldDefinition::create('plugin:plugin_test_helper_mock')
       ->setLabel(t('Plugin'))
-      ->setDisplayOptions('view', array(
+      ->setDisplayOptions('view', [
         'type' => 'plugin_label',
         'weight' => 0,
-      ))
+      ])
       ->setDisplayConfigurable('view', TRUE)
       ->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
 
Index: plugin/tests/src/Unit/Plugin/Plugin/PluginSelector/SelectListTest.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/tests/src/Unit/Plugin/Plugin/PluginSelector/SelectListTest.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/tests/src/Unit/Plugin/Plugin/PluginSelector/SelectListTest.php	(date 1563199111649)
@@ -106,40 +106,40 @@
         $plugin_id_b => $plugin_definition_b,
       ]);
 
-    $expected_build_plugin_id = array(
-      '#ajax' => array(
-        'callback' => array(SelectList::class, 'ajaxRebuildForm'),
+    $expected_build_plugin_id = [
+      '#ajax' => [
+        'callback' => [SelectList::class, 'ajaxRebuildForm'],
         'effect' => 'fade',
         'event' => 'change',
-        'trigger_as' => array(
+        'trigger_as' => [
           'name' => 'foo__bar__select__container__change',
-        ),
-      ),
+        ],
+      ],
       '#default_value' => $plugin_id_a,
       '#empty_value' => '',
-      '#options' => array(
+      '#options' => [
         $plugin_id_a => $plugin_label_a,
         $plugin_id_b => $plugin_id_b,
-      ) ,
+      ],
       '#required' => FALSE,
       '#title' => $selector_title,
       '#description' => $selector_description,
       '#type' => 'select',
-    );
-    $expected_build_change = array(
-      '#ajax' => array(
-        'callback' => array(AdvancedPluginSelectorBase::class, 'ajaxRebuildForm'),
-      ),
-      '#attributes' => array(
-        'class' => array('js-hide')
-      ),
-      '#limit_validation_errors' => array(array('foo', 'bar', 'select', 'plugin_id')),
+    ];
+    $expected_build_change = [
+      '#ajax' => [
+        'callback' => [AdvancedPluginSelectorBase::class, 'ajaxRebuildForm'],
+      ],
+      '#attributes' => [
+        'class' => ['js-hide']
+      ],
+      '#limit_validation_errors' => [['foo', 'bar', 'select', 'plugin_id']],
       '#name' => 'foo__bar__select__container__change',
       '#submit' => [[AdvancedPluginSelectorBase::class, 'rebuildForm']],
       '#type' => 'submit',
       '#value' => 'Choose',
-    );
-    $build = $method->invokeArgs($this->sut, array($element, $form_state, $available_plugins));
+    ];
+    $build = $method->invokeArgs($this->sut, [$element, $form_state, $available_plugins]);
     $this->assertEquals($expected_build_plugin_id, $build['container']['plugin_id']);
     $this->assertEquals($expected_build_change, $build['container']['change']);
     $this->assertSame('container', $build['container']['#type']);
Index: plugin/tests/modules/plugin_test_svpbf/plugin_test_svpbf.info.yml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/tests/modules/plugin_test_svpbf/plugin_test_svpbf.info.yml	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/tests/modules/plugin_test_svpbf/plugin_test_svpbf.info.yml	(date 1563199111581)
@@ -2,13 +2,13 @@
 # core: 8.x
 type: module
 dependencies:
-  - plugin
-  - plugin_test_helper
-  - views
+  - plugin:plugin
+  - plugin:plugin_test_helper
+  - drupal:views
 hidden: true
 
-# Information added by Drupal.org packaging script on 2017-04-07
-version: '8.x-2.5'
+# Information added by Drupal.org packaging script on 2019-05-19
+version: '8.x-2.6'
 core: '8.x'
 project: 'plugin'
-datestamp: 1491597185
+datestamp: 1558296185
Index: plugin/tests/src/Unit/PluginDiscovery/PluginDiscoveryDecoratorTest.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/tests/src/Unit/PluginDiscovery/PluginDiscoveryDecoratorTest.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/tests/src/Unit/PluginDiscovery/PluginDiscoveryDecoratorTest.php	(date 1563199111682)
@@ -77,8 +77,6 @@
    * @covers ::clearCachedDefinitions
    */
   public function testClearCachedDefinitionsWithUncachedDecoratedDiscovery() {
-    $this->decoratedDiscovery->expects($this->never())
-      ->method('clearCachedDefinitions');
     $this->decoratedDiscovery->expects($this->exactly(2))
       ->method('getDefinitions')
       ->willReturn([]);
Index: plugin/tests/modules/plugin_test_helper/plugin_test_helper.info.yml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/tests/modules/plugin_test_helper/plugin_test_helper.info.yml	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/tests/modules/plugin_test_helper/plugin_test_helper.info.yml	(date 1563199111530)
@@ -3,11 +3,11 @@
 # core: 8.x
 type: module
 dependencies:
-  - plugin
+  - plugin:plugin
 hidden: true
 
-# Information added by Drupal.org packaging script on 2017-04-07
-version: '8.x-2.5'
+# Information added by Drupal.org packaging script on 2019-05-19
+version: '8.x-2.6'
 core: '8.x'
 project: 'plugin'
-datestamp: 1491597185
+datestamp: 1558296185
Index: plugin/src/Plugin/Field/FieldType/PluginCollectionItemDeriver.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/src/Plugin/Field/FieldType/PluginCollectionItemDeriver.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/src/Plugin/Field/FieldType/PluginCollectionItemDeriver.php	(date 1563199111396)
@@ -42,11 +42,11 @@
   public function getDerivativeDefinitions($base_plugin_definition) {
     foreach ($this->pluginTypeManager->getPluginTypes() as $plugin_type) {
       if ($plugin_type->isFieldType()) {
-        $this->derivatives[$plugin_type->getId()] = array(
+        $this->derivatives[$plugin_type->getId()] = [
             'description' => $plugin_type->getDescription(),
             'label' => $plugin_type->getLabel(),
             'plugin_type_id' => $plugin_type->getId(),
-          ) + $base_plugin_definition;
+          ] + $base_plugin_definition;
       }
     }
 
Index: plugin/src/Plugin/Field/FieldType/PluginCollectionItemBase.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/src/Plugin/Field/FieldType/PluginCollectionItemBase.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/src/Plugin/Field/FieldType/PluginCollectionItemBase.php	(date 1563199111394)
@@ -137,24 +137,24 @@
    * {@inheritdoc}
    */
   public static function schema(FieldStorageDefinitionInterface $field_definition) {
-    $columns = array(
-      'plugin_id' => array(
+    $columns = [
+      'plugin_id' => [
         'description' => 'The plugin ID.',
         'type' => 'varchar',
         'length' => 255,
         'not null' => TRUE,
-      ),
-      'plugin_configuration' => array(
+      ],
+      'plugin_configuration' => [
         'description' => 'The plugin configuration.',
         'type' => 'blob',
         'not null' => TRUE,
         'serialize' => TRUE,
-      ),
-    );
+      ],
+    ];
 
-    $schema = array(
+    $schema = [
       'columns' => $columns,
-    );
+    ];
 
     return $schema;
   }
Index: plugin/src/Plugin/Field/FieldWidget/PluginSelectorDeriver.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/src/Plugin/Field/FieldWidget/PluginSelectorDeriver.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/src/Plugin/Field/FieldWidget/PluginSelectorDeriver.php	(date 1563199111405)
@@ -38,11 +38,11 @@
    */
   public function getDerivativeDefinitions($base_plugin_definition) {
     foreach ($this->pluginSelectorManager->getDefinitions() as $plugin_id => $plugin_definition) {
-      $this->derivatives[$plugin_id] = array(
+      $this->derivatives[$plugin_id] = [
           'description' => isset($plugin_definition['description']) ? $plugin_definition['description'] : NULL,
           'label' => $plugin_definition['label'],
           'plugin_selector_id' => $plugin_id,
-        ) + $base_plugin_definition;
+        ] + $base_plugin_definition;
     }
 
     return parent::getDerivativeDefinitions($base_plugin_definition);
Index: plugin/src/Form/SubformHelperTrait.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/src/Form/SubformHelperTrait.php	(date 1563533883791)
+++ plugin/src/Form/SubformHelperTrait.php	(date 1563533883791)
@@ -0,0 +1,21 @@
+<?php
+
+namespace Drupal\plugin\Form;
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Form\SubformStateInterface;
+
+/**
+ * Provides helpers for building subforms.
+ *
+ * @internal
+ */
+trait SubformHelperTrait {
+
+  protected function assertSubformState(FormStateInterface $form_state) {
+    if (!($form_state instanceof SubformStateInterface)) {
+      $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
+      trigger_error(sprintf('%s::%s() SHOULD receive %s on line %d, but %s was given. More information is available at https://www.drupal.org/node/2774077.', $trace[1]['class'], $trace[1]['function'], SubformStateInterface::class, $trace[1]['line'], get_class($form_state)), E_USER_DEPRECATED);
+    }
+  }
+
+}
Index: plugin/tests/fixtures/plugin_update_8001/database_dump.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/tests/fixtures/plugin_update_8001/database_dump.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/tests/fixtures/plugin_update_8001/database_dump.php	(date 1563199111525)
@@ -59,68 +59,68 @@
 
 // Create the table for the "Plugin selector" plugin field's values.
 $connection->schema()->createTable('user__field_plugin_selector', array(
-  'fields' => array(
-    'bundle' => array(
+  'fields' => [
+    'bundle' => [
       'type' => 'varchar_ascii',
       'not null' => TRUE,
       'length' => '128',
       'default' => '',
-    ),
-    'deleted' => array(
+    ],
+    'deleted' => [
       'type' => 'int',
       'not null' => TRUE,
       'size' => 'tiny',
       'default' => '0',
-    ),
-    'entity_id' => array(
+    ],
+    'entity_id' => [
       'type' => 'int',
       'not null' => TRUE,
       'size' => 'normal',
       'unsigned' => TRUE,
-    ),
-    'revision_id' => array(
+    ],
+    'revision_id' => [
       'type' => 'int',
       'not null' => TRUE,
       'size' => 'normal',
       'unsigned' => TRUE,
-    ),
-    'langcode' => array(
+    ],
+    'langcode' => [
       'type' => 'varchar_ascii',
       'not null' => TRUE,
       'length' => '32',
       'default' => '',
-    ),
-    'delta' => array(
+    ],
+    'delta' => [
       'type' => 'int',
       'not null' => TRUE,
       'size' => 'normal',
       'unsigned' => TRUE,
-    ),
-    'field_plugin_selector_plugin_id' => array(
+    ],
+    'field_plugin_selector_plugin_id' => [
       'type' => 'varchar',
       'not null' => FALSE,
       'length' => '255',
-    ),
-    'field_plugin_selector_plugin_configuration' => array(
+    ],
+    'field_plugin_selector_plugin_configuration' => [
       'type' => 'blob',
       'not null' => FALSE,
       'size' => 'normal',
-    ),
-  ),
-  'primary key' => array(
+    ],
+  ],
+  'primary key' => [
     'entity_id',
     'deleted',
     'delta',
     'langcode',
-  ),
-  'indexes' => array(
-    'bundle' => array(
+  ],
+  'indexes' => [
+    'bundle' => [
       'bundle',
-    ),
-    'revision_id' => array(
+    ],
+    'revision_id' => [
       'revision_id',
-    ),
-  ),
+    ],
+  ],
   'mysql_character_set' => 'utf8mb4',
 ));
 
@@ -171,68 +171,68 @@
   ->execute();
 
 // Create the table for the "Mock plugin" plugin field's values.
-$connection->schema()->createTable('user__field_plugin_test_helper_mock', array(
-  'fields' => array(
-    'bundle' => array(
+$connection->schema()->createTable('user__field_plugin_test_helper_mock', [
+  'fields' => [
+    'bundle' => [
       'type' => 'varchar_ascii',
       'not null' => TRUE,
       'length' => '128',
       'default' => '',
-    ),
-    'deleted' => array(
+    ],
+    'deleted' => [
       'type' => 'int',
       'not null' => TRUE,
       'size' => 'tiny',
       'default' => '0',
-    ),
-    'entity_id' => array(
+    ],
+    'entity_id' => [
       'type' => 'int',
       'not null' => TRUE,
       'size' => 'normal',
       'unsigned' => TRUE,
-    ),
-    'revision_id' => array(
+    ],
+    'revision_id' => [
       'type' => 'int',
       'not null' => TRUE,
       'size' => 'normal',
       'unsigned' => TRUE,
-    ),
-    'langcode' => array(
+    ],
+    'langcode' => [
       'type' => 'varchar_ascii',
       'not null' => TRUE,
       'length' => '32',
       'default' => '',
-    ),
-    'delta' => array(
+    ],
+    'delta' => [
       'type' => 'int',
       'not null' => TRUE,
       'size' => 'normal',
       'unsigned' => TRUE,
-    ),
-    'field_plugin_test_helper_mock_plugin_id' => array(
+    ],
+    'field_plugin_test_helper_mock_plugin_id' => [
       'type' => 'varchar',
       'not null' => FALSE,
       'length' => '255',
-    ),
-    'field_plugin_test_helper_mock_plugin_configuration' => array(
+    ],
+    'field_plugin_test_helper_mock_plugin_configuration' => [
       'type' => 'blob',
       'not null' => FALSE,
       'size' => 'normal',
-    ),
-  ),
-  'primary key' => array(
+    ],
+  ],
+  'primary key' => [
     'entity_id',
     'deleted',
     'delta',
     'langcode',
-  ),
-  'indexes' => array(
-    'bundle' => array(
+  ],
+  'indexes' => [
+    'bundle' => [
       'bundle',
-    ),
-    'revision_id' => array(
+    ],
+    'revision_id' => [
       'revision_id',
-    ),
-  ),
+    ],
+  ],
   'mysql_character_set' => 'utf8mb4',
-));
+]);
Index: plugin/src/Plugin/Plugin/PluginSelector/SelectList.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/src/Plugin/Plugin/PluginSelector/SelectList.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/src/Plugin/Plugin/PluginSelector/SelectList.php	(date 1563199111418)
@@ -25,15 +25,15 @@
     $element = parent::buildSelector($root_element, $form_state, $plugins);
     /** @var \Drupal\Component\Plugin\PluginInspectionInterface[] $plugins */
 
-    $element['container']['plugin_id'] = array(
-      '#ajax' => array(
-        'callback' => array(get_class(), 'ajaxRebuildForm'),
+    $element['container']['plugin_id'] = [
+      '#ajax' => [
+        'callback' => [get_class(), 'ajaxRebuildForm'],
         'effect' => 'fade',
         'event' => 'change',
-        'trigger_as' => array(
+        'trigger_as' => [
           'name' => $element['container']['change']['#name'],
-        ),
-      ),
+        ],
+      ],
       '#default_value' => $this->getSelectedPlugin() ? $this->getSelectedPlugin()->getPluginId() : NULL,
       '#empty_value' => '',
       '#options' => $this->buildOptionsLevel($this->buildPluginHierarchy($this->selectablePluginDiscovery)),
@@ -41,7 +41,7 @@
       '#title' => $this->getLabel(),
       '#description' => $this->getDescription(),
       '#type' => 'select',
-    );
+    ];
 
     return $element;
   }
Index: plugin/plugin.info.yml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/plugin.info.yml	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/plugin.info.yml	(date 1563199111337)
@@ -4,10 +4,10 @@
 type: module
 configure: plugin.plugin_type.list
 dependencies:
-  - system (>=8.0.5)
+  - drupal:system (>=8.0.5)
 
-# Information added by Drupal.org packaging script on 2017-04-07
-version: '8.x-2.5'
+# Information added by Drupal.org packaging script on 2019-05-19
+version: '8.x-2.6'
 core: '8.x'
 project: 'plugin'
-datestamp: 1491597185
+datestamp: 1558296185
Index: plugin/tests/src/Unit/OperationsProviderTestTrait.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/tests/src/Unit/OperationsProviderTestTrait.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/tests/src/Unit/OperationsProviderTestTrait.php	(date 1563199111625)
@@ -15,11 +15,11 @@
    */
   protected function assertOperationsLinks(array $operations_links) {
     foreach ($operations_links as $link) {
-      \PHPUnit_Framework_Assert::assertArrayHasKey('title', $link);
-      \PHPUnit_Framework_Assert::assertNotEmpty($link['title']);
+      \PHPUnit\Framework\Assert::assertArrayHasKey('title', $link);
+      \PHPUnit\Framework\Assert::assertNotEmpty($link['title']);
 
-      \PHPUnit_Framework_Assert::assertArrayHasKey('url', $link);
-      \PHPUnit_Framework_Assert::assertInstanceOf(Url::class, $link['url']);
+      \PHPUnit\Framework\Assert::assertArrayHasKey('url', $link);
+      \PHPUnit\Framework\Assert::assertInstanceOf(Url::class, $link['url']);
     }
   }
 
Index: plugin/plugin.plugin_type.yml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/plugin.plugin_type.yml	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/plugin.plugin_type.yml	(date 1563199111346)
@@ -149,6 +149,34 @@
   plugin_manager_service_id: plugin.manager.language_negotiation_method
   plugin_definition_decorator_class: \Drupal\plugin\PluginDefinition\ArrayPluginDefinitionDecorator
 
+# Migrate's plugin types.
+# Leave source plugins out for now, as the list page for them crashes!
+# migrate_source:
+#   label: Migrate source
+#   provider: migrate
+#   plugin_manager_service_id: plugin.manager.migrate.source
+#   plugin_definition_decorator_class: \Drupal\plugin\PluginDefinition\ArrayPluginDefinitionDecorator
+migrate_process:
+  label: Migrate process
+  provider: migrate
+  plugin_manager_service_id: plugin.manager.migrate.process
+  plugin_definition_decorator_class: \Drupal\plugin\PluginDefinition\ArrayPluginDefinitionDecorator
+migrate_destination:
+  label: Migrate destination
+  provider: migrate
+  plugin_manager_service_id: plugin.manager.migrate.destination
+  plugin_definition_decorator_class: \Drupal\plugin\PluginDefinition\ArrayPluginDefinitionDecorator
+migrate_id_map:
+  label: Migrate ID map
+  provider: migrate
+  plugin_manager_service_id: plugin.manager.migrate.id_map
+  plugin_definition_decorator_class: \Drupal\plugin\PluginDefinition\ArrayPluginDefinitionDecorator
+migration:
+  label: Migration
+  provider: migrate
+  plugin_manager_service_id: plugin.manager.migration
+  plugin_definition_decorator_class: \Drupal\plugin\PluginDefinition\ArrayPluginDefinitionDecorator
+
 # Quick Edit's plugin types.
 quickedit_editor:
   label: Quick Edit editor
Index: plugin/tests/src/Unit/Plugin/PluginOperationsProviderPluginManagerTraitTest.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/tests/src/Unit/Plugin/PluginOperationsProviderPluginManagerTraitTest.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/tests/src/Unit/Plugin/PluginOperationsProviderPluginManagerTraitTest.php	(date 1563199111650)
@@ -38,15 +38,15 @@
    * @covers ::getOperationsProvider
    */
   public function testGetOperationsProvider() {
-    $plugin_definitions = array(
-      'foo' => array(
+    $plugin_definitions = [
+      'foo' => [
         'id' => 'foo',
         'operations_provider' => PluginOperationsProviderPluginManagerTraitUnitTestOperationsProvider::class,
-      ),
-      'bar' => array(
+      ],
+      'bar' => [
         'id' => 'bar',
-      ),
-    );
+      ],
+    ];
 
     $operations_provider = new \stdClass();
 
Index: plugin/src/PluginType/PluginTypeManager.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/src/PluginType/PluginTypeManager.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/src/PluginType/PluginTypeManager.php	(date 1563199111501)
@@ -80,11 +80,17 @@
 
     $this->pluginTypes = [];
 
+    // List the available plugin type providers.
+    $providers = array_map(function(Extension $module) {
+      return $module->getName();
+    }, $this->moduleHandler->getModuleList());
+    $providers[] = 'core';
+
     // \Drupal\Component\Discovery\YamlDiscovery::findAll() caches raw file
     // contents, but we want to cache plugin types for better performance.
     $files = $this->findFiles();
     $providers_by_file = array_flip($files);
-    $file_cache = FileCacheFactory::get('plugin:plugin_type');
+    $file_cache = FileCacheFactory::get('plugin:plugin_type:' . hash('sha256', serialize($providers)));
 
     // Try to load from the file cache first.
     foreach ($file_cache->getMultiple($files) as $file => $plugin_types_by_file) {
@@ -92,12 +98,6 @@
       unset($providers_by_file[$file]);
     }
 
-    // List the available plugin type providers.
-    $providers = array_map(function(Extension $module) {
-      return $module->getName();
-    }, $this->moduleHandler->getModuleList());
-    $providers[] = 'core';
-
     // If there are files left that were not returned from the cache, load and
     // parse them now. This list was flipped above and is keyed by filename.
     foreach ($providers_by_file as $file => $provider) {
Index: plugin/src/PluginType/PluginTypeInterface.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/src/PluginType/PluginTypeInterface.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/src/PluginType/PluginTypeInterface.php	(date 1563199111500)
@@ -49,6 +49,14 @@
    */
   public function getProvider();
 
+  /**
+   * Gets the service name of the plugin manager.
+   *
+   * @return string
+   *   The service name of the plugin manager.
+   */
+  public function getPluginManagerServiceName();
+
   /**
    * Gets the plugin manager.
    *
Index: plugin/src/PluginType/PluginType.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugin/src/PluginType/PluginType.php	(revision e3ffe3f86c295021c90f1fe3fcfd12661cb3746f)
+++ plugin/src/PluginType/PluginType.php	(date 1563199111498)
@@ -192,6 +192,13 @@
     return $this->provider;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function getPluginManagerServiceName() {
+    return $this->pluginManagerServiceId;
+  }
+
   /**
    * {@inheritdoc}
    */
