protected function getDerivatives(array
$base_plugin_definitions) { $plugin_definitions =
[];
foreach ($base_plugin_definitions as $base_plugin_id =>
$plugin_definition) { $deriver =
$this->
getDeriver($base_plugin_id,
$plugin_definition);
if ($deriver) { $derivative_definitions =
$deriver->
getDerivativeDefinitions($plugin_definition);
foreach ($derivative_definitions as $derivative_id =>
$derivative_definition) { $plugin_id =
$this->
encodePluginId($base_plugin_id,
$derivative_id);
// Use this definition as defaults if a plugin already defined
// itself as this derivative.
if ($derivative_id &&
isset($base_plugin_definitions[$plugin_id])) { $derivative_definition =
$this->
mergeDerivativeDefinition($base_plugin_definitions[$plugin_id],
$derivative_definition);
} $plugin_definitions[$plugin_id] =
$derivative_definition;
} } // If a plugin already defined itself as a derivative it might already
// be merged into the definitions.
elseif (!
isset($plugin_definitions[$base_plugin_id])) {