Skip to content

Commit 08213c5

Browse files
committed
deps: upgrade to phpstan 2.0
1 parent 97272ee commit 08213c5

4 files changed

Lines changed: 50 additions & 33 deletions

File tree

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"phpmailer/phpmailer": "^7.0",
3131
"phpunit/phpunit": "^8.0 || ^9.0",
3232
"symfony/polyfill-php80": "^1.28",
33-
"szepeviktor/phpstan-wordpress": "^1.0",
33+
"szepeviktor/phpstan-wordpress": "^2.0",
3434
"vlucas/phpdotenv": "^5.6"
3535
},
3636
"config": {
@@ -57,6 +57,7 @@
5757
"scripts": {
5858
"php-cs-fixer": "php-cs-fixer fix --dry-run --allow-risky=yes",
5959
"phpstan": "phpstan analyze --ansi",
60+
"phpstan:generate-baseline": "phpstan analyze --generate-baseline",
6061
"tests:integration": "phpunit --testsuite integration",
6162
"tests:unit": "phpunit --testsuite unit"
6263
}

phpstan-baseline.neon

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: '#^Parameter \$image of method Ymir\\Plugin\\Attachment\\GDImageEditor\:\:_save\(\) has invalid type GdImage\.$#'
5+
identifier: class.notFound
6+
count: 1
7+
path: src/Attachment/GDImageEditor.php
8+
9+
-
10+
message: '#^Class CurlHandle not found\.$#'
11+
identifier: class.notFound
12+
count: 1
13+
path: src/Http/CurlClient.php
14+
15+
-
16+
message: '#^Constant WPINC not found\.$#'
17+
identifier: constant.notFound
18+
count: 1
19+
path: src/Http/CurlClient.php
20+
21+
-
22+
message: '#^Parameter \#3 \$value of function curl_setopt expects int, float given\.$#'
23+
identifier: argument.type
24+
count: 2
25+
path: src/Http/CurlClient.php
26+
27+
-
28+
message: '#^Property Ymir\\Plugin\\Http\\CurlClient\:\:\$handle \(CurlHandle\|resource\) is never assigned CurlHandle so it can be removed from the property type\.$#'
29+
identifier: property.unusedType
30+
count: 1
31+
path: src/Http/CurlClient.php
32+
33+
-
34+
message: '#^Property Ymir\\Plugin\\Http\\CurlClient\:\:\$handle has unknown class CurlHandle as its type\.$#'
35+
identifier: class.notFound
36+
count: 1
37+
path: src/Http/CurlClient.php

phpstan.neon

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
includes:
2-
- vendor/szepeviktor/phpstan-wordpress/extension.neon
2+
- ./phpstan-baseline.neon
3+
- ./vendor/szepeviktor/phpstan-wordpress/extension.neon
34
parameters:
5+
level: 5
6+
treatPhpDocTypesAsCertain: false
7+
phpVersion:
8+
min: 70200
9+
max: 80500
10+
bootstrapFiles:
11+
- vendor/php-stubs/wp-cli-stubs/wp-cli-stubs.php
412
paths:
513
- ymir.php
614
- bootstrap.php
715
- pluggable.php
816
- src/
9-
bootstrapFiles:
10-
- tests/phpstan/bootstrap.php
11-
- vendor/php-stubs/wp-cli-stubs/wp-cli-stubs.php
12-
level: 5
17+
excludePaths:
18+
- src/Configuration/*

tests/phpstan/bootstrap.php

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

0 commit comments

Comments
 (0)