Skip to content

Commit 90e1756

Browse files
committed
Fixed extension.neon
1 parent eb4b487 commit 90e1756

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

extension.neon

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ services:
1212
class: PHPStan\Symfony\ServiceMapFactory
1313
factory: PHPStan\Symfony\XmlServiceMapFactory(%symfony.container_xml_path%)
1414
-
15-
class: PHPStan\Symfony\ServiceMap(@symfony.serviceMapFactory::create())
15+
class: @symfony.serviceMapFactory::create()
1616

1717
# ControllerTrait::get()/has() return type
1818
-

tests/Symfony/NeonTest.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,25 @@ public function testExtensionNeon(): void
2424

2525
$class = $loader->load(function (Compiler $compiler): void {
2626
$compiler->addExtension('rules', new RulesExtension());
27+
$compiler->addConfig(['parameters' => ['rootDir' => __DIR__]]);
2728
$compiler->loadConfig(__DIR__ . '/config.neon');
2829
$compiler->loadConfig(__DIR__ . '/../../extension.neon');
2930
}, $key);
3031
/** @var \Nette\DI\Container $container */
3132
$container = new $class();
3233

3334
self::assertSame([
35+
'rootDir' => __DIR__,
3436
'symfony' => [
35-
'container_xml_path' => '',
37+
'container_xml_path' => __DIR__ . '/container.xml',
3638
'constant_hassers' => true,
3739
],
3840
], $container->getParameters());
3941

4042
self::assertCount(2, $container->findByTag('phpstan.rules.rule'));
4143
self::assertCount(4, $container->findByTag('phpstan.broker.dynamicMethodReturnTypeExtension'));
4244
self::assertCount(3, $container->findByTag('phpstan.typeSpecifier.methodTypeSpecifyingExtension'));
45+
self::assertInstanceOf(ServiceMap::class, $container->getByType(ServiceMap::class));
4346
}
4447

4548
}

tests/Symfony/config.neon

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
parameters:
22
symfony:
3-
container_xml_path: ''
3+
container_xml_path: %rootDir%/container.xml
44

55
services:
66
- PhpParser\PrettyPrinter\Standard

0 commit comments

Comments
 (0)