Skip to content

Commit

Permalink
Fixed extension.neon
Browse files Browse the repository at this point in the history
  • Loading branch information
lookyman committed Oct 30, 2018
1 parent eb4b487 commit 90e1756
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion extension.neon
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
class: PHPStan\Symfony\ServiceMapFactory
factory: PHPStan\Symfony\XmlServiceMapFactory(%symfony.container_xml_path%)
-
class: PHPStan\Symfony\ServiceMap(@symfony.serviceMapFactory::create())
class: @symfony.serviceMapFactory::create()

# ControllerTrait::get()/has() return type
-
Expand Down
5 changes: 4 additions & 1 deletion tests/Symfony/NeonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,25 @@ public function testExtensionNeon(): void

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

self::assertSame([
'rootDir' => __DIR__,
'symfony' => [
'container_xml_path' => '',
'container_xml_path' => __DIR__ . '/container.xml',
'constant_hassers' => true,
],
], $container->getParameters());

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

}
2 changes: 1 addition & 1 deletion tests/Symfony/config.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
parameters:
symfony:
container_xml_path: ''
container_xml_path: %rootDir%/container.xml

services:
- PhpParser\PrettyPrinter\Standard

0 comments on commit 90e1756

Please sign in to comment.