Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a222e65

Browse files
committed
Merge branch 'rules' of git://github.com/mcfedr/phpstan-symfony into mcfedr-rules
2 parents 79c938c + f79eb89 commit a222e65

File tree

5 files changed

+18
-10
lines changed

5 files changed

+18
-10
lines changed

‎README.md‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ If you don't want to use `phpstan/extension-installer`, include extension.neon i
3737
includes:
3838
- vendor/phpstan/phpstan-symfony/extension.neon
3939
```
40+
41+
To perform framework-specific checks, include also this file:
42+
43+
```
44+
includes:
45+
- vendor/phpstan/phpstan-symfony/rules.neon
46+
```
4047
</details>
4148

4249
# Configuration
@@ -51,7 +58,6 @@ parameters:
5158
container_xml_path: '%rootDir%/../../../var/cache/dev/srcApp_KernelDevDebugContainer.xml'
5259
```
5360

54-
5561
## Constant hassers
5662

5763
Sometimes, when you are dealing with optional dependencies, the `::has()` methods can cause problems. For example, the following construct would complain that the condition is always either on or off, depending on whether you have the dependency for `service` installed:

‎composer.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
},
1919
"phpstan": {
2020
"includes": [
21-
"extension.neon"
21+
"extension.neon",
22+
"rules.neon"
2223
]
2324
}
2425
},

‎extension.neon‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ parametersSchema:
1111
console_application_loader: schema(string(), nullable())
1212
])
1313

14-
rules:
15-
- PHPStan\Rules\Symfony\ContainerInterfacePrivateServiceRule
16-
- PHPStan\Rules\Symfony\ContainerInterfaceUnknownServiceRule
17-
- PHPStan\Rules\Symfony\UndefinedArgumentRule
18-
- PHPStan\Rules\Symfony\InvalidArgumentDefaultValueRule
19-
- PHPStan\Rules\Symfony\UndefinedOptionRule
20-
- PHPStan\Rules\Symfony\InvalidOptionDefaultValueRule
21-
2214
services:
2315
# console resolver
2416
-

‎rules.neon‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
rules:
2+
- PHPStan\Rules\Symfony\ContainerInterfacePrivateServiceRule
3+
- PHPStan\Rules\Symfony\ContainerInterfaceUnknownServiceRule
4+
- PHPStan\Rules\Symfony\UndefinedArgumentRule
5+
- PHPStan\Rules\Symfony\InvalidArgumentDefaultValueRule
6+
- PHPStan\Rules\Symfony\UndefinedOptionRule
7+
- PHPStan\Rules\Symfony\InvalidOptionDefaultValueRule
8+

‎tests/Symfony/NeonTest.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public function testExtensionNeon(): void
2828
$compiler->addExtension('parametersSchema', new ParametersSchemaExtension());
2929
$compiler->addConfig(['parameters' => ['rootDir' => __DIR__]]);
3030
$compiler->loadConfig(__DIR__ . '/../../extension.neon');
31+
$compiler->loadConfig(__DIR__ . '/../../rules.neon');
3132
$compiler->loadConfig(__DIR__ . '/config.neon');
3233
}, $key);
3334
/** @var \Nette\DI\Container $container */

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /