File tree 1 file changed +5
-0
lines changed
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 3
3
namespace mglaman \PHPStanDrupal \Drupal ;
4
4
5
5
use Composer \Autoload \ClassLoader ;
6
+ use Drupal \Component \DependencyInjection \Container as DrupalContainer ;
6
7
use Drupal \Core \DependencyInjection \ContainerNotInitializedException ;
7
8
use Drupal \Core \DrupalKernelInterface ;
8
9
use Drupal \TestTools \PhpUnitCompatibility \PhpUnit8 \ClassWriter ;
12
13
use PHPUnit \Framework \Test ;
13
14
use ReflectionClass ;
14
15
use RuntimeException ;
16
+ use Symfony \Component \DependencyInjection \ContainerInterface ;
15
17
use Symfony \Component \Finder \Finder ;
16
18
use Symfony \Component \Yaml \Yaml ;
17
19
use Throwable ;
@@ -108,7 +110,10 @@ public function register(Container $container): void
108
110
// Attach synthetic services
109
111
// @see \Drupal\Core\DrupalKernel::attachSynthetic
110
112
$ this ->serviceMap ['kernel ' ] = ['class ' => DrupalKernelInterface::class];
113
+ $ this ->serviceMap [DrupalKernelInterface::class] = ['alias ' => 'kernel ' ];
111
114
$ this ->serviceMap ['class_loader ' ] = ['class ' => ClassLoader::class];
115
+ $ this ->serviceMap ['service_container ' ] = ['class ' => DrupalContainer::class];
116
+ $ this ->serviceMap [ContainerInterface::class] = ['alias ' => 'service_container ' ];
112
117
113
118
$ extensionDiscovery = new ExtensionDiscovery ($ this ->drupalRoot );
114
119
$ extensionDiscovery ->setProfileDirectories ([]);
You can’t perform that action at this time.
0 commit comments