More updates to stop using dev or alpha or beta versions.
[yaffs-website] / web / core / tests / Drupal / Tests / Core / Plugin / Discovery / TestDerivativeDiscoveryWithObject.php
1 <?php
2
3 namespace Drupal\Tests\Core\Plugin\Discovery;
4
5 use Drupal\Component\Plugin\Derivative\DeriverInterface;
6
7 /**
8  * Defines test derivative discovery using an object..
9  */
10 class TestDerivativeDiscoveryWithObject implements DeriverInterface {
11
12   /**
13    * {@inheritdoc}
14    * @param string $derivative_id
15    * @param array $base_plugin_definition
16    * @return array
17    */
18   public function getDerivativeDefinition($derivative_id, $base_plugin_definition) {
19     $definitions = $this->getDerivativeDefinitions($base_plugin_definition);
20     return $definitions[$derivative_id];
21   }
22
23   /**
24    * {@inheritdoc}
25    * @param array $base_plugin_definition
26    * @return array
27    */
28   public function getDerivativeDefinitions($base_plugin_definition) {
29     $plugins = [];
30     for ($i = 0; $i < 2; $i++) {
31       $plugins['test_discovery_' . $i] = $base_plugin_definition;
32     }
33     return $plugins;
34   }
35
36 }