Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
50.00% |
1 / 2 |
CRAP | |
20.00% |
1 / 5 |
| DeriverBase | |
0.00% |
0 / 1 |
|
50.00% |
1 / 2 |
12.19 | |
20.00% |
1 / 5 |
| getDerivativeDefinition | |
0.00% |
0 / 1 |
12 | |
0.00% |
0 / 4 |
|||
| getDerivativeDefinitions | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| <?php | |
| /** | |
| * @file | |
| * Contains \Drupal\Component\Plugin\Derivative\DeriverBase. | |
| */ | |
| namespace Drupal\Component\Plugin\Derivative; | |
| /** | |
| * Provides a basic deriver. | |
| */ | |
| abstract class DeriverBase implements DeriverInterface { | |
| /** | |
| * List of derivative definitions. | |
| * | |
| * @var array | |
| */ | |
| protected $derivatives = array(); | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| public function getDerivativeDefinition($derivative_id, $base_plugin_definition) { | |
| if (!empty($this->derivatives) && !empty($this->derivatives[$derivative_id])) { | |
| return $this->derivatives[$derivative_id]; | |
| } | |
| $this->getDerivativeDefinitions($base_plugin_definition); | |
| return $this->derivatives[$derivative_id]; | |
| } | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| public function getDerivativeDefinitions($base_plugin_definition) { | |
| return $this->derivatives; | |
| } | |
| } |