Skip to content

Commit c7be305

Browse files
authored
Merge pull request #48 from phpstan/updates
Various updates
2 parents c4da70e + fcaef71 commit c7be305

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@
2525
"require": {
2626
"php": "^7.1",
2727
"ext-simplexml": "*",
28-
"phpstan/phpstan": "^0.11.1",
28+
"phpstan/phpstan": "^0.11.7",
2929
"nikic/php-parser": "^4.0"
3030
},
3131
"require-dev": {
3232
"consistence/coding-standard": "^3.0.1",
3333
"jakub-onderka/php-parallel-lint": "^1.0",
3434
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
35+
"nette/di": "^3.0-stable",
3536
"phpunit/phpunit": "^7.0",
3637
"phing/phing": "^2.16.0",
3738
"phpstan/phpstan-strict-rules": "^0.11",

extension.neon

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ parameters:
44
constant_hassers: true
55
console_application_loader: null
66

7+
parametersSchema:
8+
symfony: structure([
9+
container_xml_path: schema(string(), nullable())
10+
constant_hassers: bool()
11+
console_application_loader: schema(string(), nullable())
12+
])
13+
714
rules:
815
- PHPStan\Rules\Symfony\ContainerInterfacePrivateServiceRule
916
- PHPStan\Rules\Symfony\ContainerInterfaceUnknownServiceRule

phpstan.neon

+2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
includes:
2+
- extension.neon
23
- vendor/phpstan/phpstan-phpunit/extension.neon
34
- vendor/phpstan/phpstan-phpunit/rules.neon
45
- vendor/phpstan/phpstan-strict-rules/rules.neon
6+
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
57

68
parameters:
79
excludes_analyse:

tests/Symfony/NeonTest.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Nette\DI\Compiler;
66
use Nette\DI\ContainerLoader;
7+
use PHPStan\DependencyInjection\ParametersSchemaExtension;
78
use PHPStan\DependencyInjection\RulesExtension;
89
use PHPUnit\Framework\TestCase;
910
use function sprintf;
@@ -24,21 +25,25 @@ public function testExtensionNeon(): void
2425

2526
$class = $loader->load(function (Compiler $compiler): void {
2627
$compiler->addExtension('rules', new RulesExtension());
28+
$compiler->addExtension('parametersSchema', new ParametersSchemaExtension());
2729
$compiler->addConfig(['parameters' => ['rootDir' => __DIR__]]);
2830
$compiler->loadConfig(__DIR__ . '/../../extension.neon');
2931
$compiler->loadConfig(__DIR__ . '/config.neon');
3032
}, $key);
3133
/** @var \Nette\DI\Container $container */
3234
$container = new $class();
3335

36+
$parameters = $container->getParameters();
37+
unset($parameters['__parametersSchema']);
38+
3439
self::assertSame([
3540
'rootDir' => __DIR__,
3641
'symfony' => [
3742
'container_xml_path' => __DIR__ . '/container.xml',
3843
'constant_hassers' => true,
3944
'console_application_loader' => null,
4045
],
41-
], $container->getParameters());
46+
], $parameters);
4247

4348
self::assertCount(6, $container->findByTag('phpstan.rules.rule'));
4449
self::assertCount(11, $container->findByTag('phpstan.broker.dynamicMethodReturnTypeExtension'));

0 commit comments

Comments
 (0)