3 namespace Drupal\drupalmoduleupgrader;
5 use Symfony\Component\DependencyInjection\ContainerInterface;
8 * Provides a default implementation of ContainerFactoryPluginInterface which
9 * will pull any dependencies declared in the plugin definition out of the
12 trait DependencyCollectorTrait {
17 public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
18 $arguments = array_slice(func_get_args(), 1);
19 $arguments += array_map([ $container, 'get' ], @($plugin_definition['dependencies'] ? : []));
20 return (new \ReflectionClass(get_called_class()))->newInstanceArgs($arguments);