decorated = $decorated; } /** * {@inheritdoc} */ public function getDefinitions() { /** @var \Drupal\Component\Plugin\PluginManagerInterface $source_plugin_manager */ $source_plugin_manager = \Drupal::service('plugin.manager.migrate.source'); return array_filter($this->decorated->getDefinitions(), function (array $definition) use ($source_plugin_manager) { return $source_plugin_manager->hasDefinition($definition['source']['plugin']); }); } /** * Passes through all unknown calls onto the decorated object. * * @param string $method * The method to call on the decorated object. * @param array $args * Call arguments. * * @return mixed * The return value from the method on the decorated object. */ public function __call($method, array $args) { return call_user_func_array([$this->decorated, $method], $args); } }