Skip to content

Commit dbe5071

Browse files
committed
Upgrade ekino/phpstan-banned-code and update PHPStan baseline.
Updated `composer.json` to require `ekino/phpstan-banned-code` version 2.0. Added new error messages to the PHPStan baseline, addressing binary operation issues and parameter expectations in various library components. These changes improve static analysis by accommodating new rules introduced in the updated dependency.
1 parent 47e3285 commit dbe5071

File tree

2 files changed

+52
-12
lines changed

2 files changed

+52
-12
lines changed

composer.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,28 +64,28 @@
6464
"ext-curl": "*",
6565
"ext-gmp": "*",
6666
"ext-sodium": "*",
67-
"ekino/phpstan-banned-code": "^1.0 || ^2.0",
67+
"ekino/phpstan-banned-code": "^2.0|^3.0",
6868
"ergebnis/phpunit-slow-test-detector": "^2.14",
6969
"infection/infection": "^0.29",
7070
"matthiasnoback/symfony-config-test": "5.1.x-dev",
7171
"paragonie/sodium_compat": "^1.20|^2.0",
7272
"php-parallel-lint/php-parallel-lint": "^1.3",
7373
"phpbench/phpbench": "^1.2",
74-
"phpstan/extension-installer": "^1.3",
75-
"phpstan/phpstan": "^1.8",
76-
"phpstan/phpstan-deprecation-rules": "^1.0",
77-
"phpstan/phpstan-doctrine": "^1.3",
78-
"phpstan/phpstan-phpunit": "^1.1",
79-
"phpstan/phpstan-strict-rules": "^1.4",
80-
"phpstan/phpstan-symfony": "^1.3",
74+
"phpstan/extension-installer": "^1.3|^2.0",
75+
"phpstan/phpstan": "^1.8|^2.0",
76+
"phpstan/phpstan-deprecation-rules": "^1.0|^2.0",
77+
"phpstan/phpstan-doctrine": "^1.3|^2.0",
78+
"phpstan/phpstan-phpunit": "^1.1|^2.0",
79+
"phpstan/phpstan-strict-rules": "^1.4|^2.0",
80+
"phpstan/phpstan-symfony": "^1.3|^2.0",
8181
"phpunit/phpunit": "^10.5.10|^11.0",
8282
"qossmic/deptrac": "^2.0",
83-
"rector/rector": "^1.0",
83+
"rector/rector": "^1.0|^2.0.0-rc3",
8484
"roave/security-advisories": "dev-latest",
8585
"spomky-labs/aes-key-wrap": "^7.0",
86-
"staabm/phpstan-dba": "^0.2.79",
87-
"staabm/phpstan-todo-by": "^0.1.25",
88-
"struggle-for-php/sfp-phpstan-psr-log": "^0.20|^0.21|^0.22",
86+
"staabm/phpstan-dba": "^0.2.79|^0.3",
87+
"staabm/phpstan-todo-by": "^0.1.25|^0.2",
88+
"struggle-for-php/sfp-phpstan-psr-log": "^0.20|^0.21|^0.22|^0.23",
8989
"symfony/browser-kit": "^7.0",
9090
"symfony/http-client": "^7.0",
9191
"symfony/clock": "^7.0",

phpstan-baseline.neon

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,26 @@ parameters:
12701270
count: 2
12711271
path: src/Library/Core/Util/Base64UrlSafe.php
12721272

1273+
-
1274+
message: "#^Binary operation \"\\.\" between '30740201010420' and mixed results in an error\\.$#"
1275+
count: 1
1276+
path: src/Library/Core/Util/ECKey.php
1277+
1278+
-
1279+
message: "#^Binary operation \"\\.\" between '30770201010420' and mixed results in an error\\.$#"
1280+
count: 1
1281+
path: src/Library/Core/Util/ECKey.php
1282+
1283+
-
1284+
message: "#^Binary operation \"\\.\" between '3081a40201010430' and mixed results in an error\\.$#"
1285+
count: 1
1286+
path: src/Library/Core/Util/ECKey.php
1287+
1288+
-
1289+
message: "#^Binary operation \"\\.\" between '3081dc0201010442' and mixed results in an error\\.$#"
1290+
count: 1
1291+
path: src/Library/Core/Util/ECKey.php
1292+
12731293
-
12741294
message: "#^Method Jose\\\\Component\\\\Core\\\\Util\\\\ECKey\\:\\:createECKey\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#"
12751295
count: 1
@@ -1360,11 +1380,31 @@ parameters:
13601380
count: 1
13611381
path: src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDH.php
13621382

1383+
-
1384+
message: "#^Binary operation \"\\.\" between mixed and \"\\\\000\" results in an error\\.$#"
1385+
count: 2
1386+
path: src/Library/Encryption/Algorithm/KeyEncryption/PBES2AESKW.php
1387+
1388+
-
1389+
message: "#^Parameter \\#1 \\$algo of function hash_pbkdf2 expects non\\-falsy\\-string, string given\\.$#"
1390+
count: 2
1391+
path: src/Library/Encryption/Algorithm/KeyEncryption/PBES2AESKW.php
1392+
13631393
-
13641394
message: "#^Parameter \\#1 \\$length of function random_bytes expects int\\<1, max\\>, int given\\.$#"
13651395
count: 1
13661396
path: src/Library/Encryption/Algorithm/KeyEncryption/PBES2AESKW.php
13671397

1398+
-
1399+
message: "#^Parameter \\#4 \\$iterations of function hash_pbkdf2 expects int\\<1, max\\>, int given\\.$#"
1400+
count: 2
1401+
path: src/Library/Encryption/Algorithm/KeyEncryption/PBES2AESKW.php
1402+
1403+
-
1404+
message: "#^Parameter \\#5 \\$length of function hash_pbkdf2 expects int\\<0, max\\>, int given\\.$#"
1405+
count: 2
1406+
path: src/Library/Encryption/Algorithm/KeyEncryption/PBES2AESKW.php
1407+
13681408
-
13691409
message: "#^Parameter \\#1 \\$length of function random_bytes expects int\\<1, max\\>, int given\\.$#"
13701410
count: 1

0 commit comments

Comments
 (0)