TestContainerDerivativeDiscovery.php in Drupal 8
File
core/tests/Drupal/Tests/Core/Plugin/Discovery/TestContainerDerivativeDiscovery.php
View source
<?php
namespace Drupal\Tests\Core\Plugin\Discovery;
use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class TestContainerDerivativeDiscovery extends TestDerivativeDiscovery implements ContainerDeriverInterface {
public function __construct(EventDispatcherInterface $example_service) {
}
public static function create(ContainerInterface $container, $base_plugin_id) {
return new static($container
->get('example_service'));
}
}