Skip to content

Commit 1aeb98d

Browse files
committed
[PHPStan] Replace custom ForbidEmptyRule with phpstan-strict-rules DisallowEmptyRule
1 parent 2180fb5 commit 1aeb98d

File tree

12 files changed

+33
-74
lines changed

12 files changed

+33
-74
lines changed

.phpstan/ForbidEmptyRule.php

Lines changed: 0 additions & 68 deletions
This file was deleted.

.phpstan/extension.neon

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1-
rules:
2-
- Symfony\AI\PHPStan\ForbidDeclareStrictTypesRule
3-
- Symfony\AI\PHPStan\ForbidNativeExceptionRule
4-
- Symfony\AI\PHPStan\ForbidTestCoverageAttributesRule
5-
- Symfony\AI\PHPStan\ForbidEmptyRule
1+
parameters:
2+
customRulesetUsed: true
3+
4+
services:
5+
-
6+
class: PHPStan\Rules\DisallowedConstructs\DisallowedEmptyRule
7+
tags:
8+
- phpstan.rules.rule
9+
-
10+
class: Symfony\AI\PHPStan\ForbidDeclareStrictTypesRule
11+
tags:
12+
- phpstan.rules.rule
13+
-
14+
class: Symfony\AI\PHPStan\ForbidNativeExceptionRule
15+
tags:
16+
- phpstan.rules.rule
17+
-
18+
class: Symfony\AI\PHPStan\ForbidTestCoverageAttributesRule
19+
tags:
20+
- phpstan.rules.rule

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"require-dev": {
99
"php": ">=8.2",
1010
"php-cs-fixer/shim": "^3.75",
11+
"phpstan/phpstan-strict-rules": "^2.0",
1112
"symfony/filesystem": "^7.3|^8.0",
1213
"symfony/finder": "^7.3|^8.0"
1314
},

demo/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"require-dev": {
4141
"php-cs-fixer/shim": "^3.75",
4242
"phpstan/phpstan": "^2.1",
43+
"phpstan/phpstan-strict-rules": "^2.0",
4344
"phpunit/phpunit": "^11.5",
4445
"symfony/browser-kit": "~7.3.0",
4546
"symfony/debug-bundle": "~7.3.0",

examples/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
"symfony/var-dumper": "^7.3|^8.0"
3333
},
3434
"require-dev": {
35-
"phpstan/phpstan": "^2.1"
35+
"phpstan/phpstan": "^2.1",
36+
"phpstan/phpstan-strict-rules": "^2.0"
3637
},
3738
"minimum-stability": "dev",
3839
"autoload": {

src/agent/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"require-dev": {
3636
"mrmysql/youtube-transcript": "^0.0.5",
3737
"phpstan/phpstan": "^2.0",
38+
"phpstan/phpstan-strict-rules": "^2.0",
3839
"phpunit/phpunit": "^11.5.13",
3940
"symfony/ai-store": "@dev",
4041
"symfony/cache": "^7.3|^8.0",

src/ai-bundle/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"require-dev": {
2828
"google/auth": "^1.47",
2929
"phpstan/phpstan": "^2.1",
30+
"phpstan/phpstan-strict-rules": "^2.0",
3031
"phpunit/phpunit": "^11.5",
3132
"symfony/expression-language": "^7.3|^8.0",
3233
"symfony/security-core": "^7.3|^8.0"

src/ai-bundle/phpstan.dist.neon

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ parameters:
2020
message: '#method_exists\(\) with Symfony\\Component\\Security\\Core\\Exception\\AccessDeniedException and ''setAccessDecision'' will always evaluate to true#'
2121
path: src/*
2222
reportUnmatched: false # only needed for Symfony < 7.3 versions
23+
-
24+
identifier: empty.notAllowed
25+
path: config/options.php

src/mcp-bundle/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
},
2222
"require-dev": {
2323
"phpstan/phpstan": "^2.1",
24+
"phpstan/phpstan-strict-rules": "^2.0",
2425
"phpunit/phpunit": "^11.5"
2526
},
2627
"minimum-stability": "dev",

src/mcp-sdk/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
},
2121
"require-dev": {
2222
"phpstan/phpstan": "^2.1",
23+
"phpstan/phpstan-strict-rules": "^2.0",
2324
"phpunit/phpunit": "^11.5",
2425
"psr/cache": "^3.0",
2526
"symfony/console": "^7.3|^8.0"

0 commit comments

Comments
 (0)