Skip to content

Commit 7ec3a3f

Browse files
authored
Added phpstan/phpstan-deprecation-rules (#183)
1 parent 1870979 commit 7ec3a3f

File tree

4 files changed

+56
-1
lines changed

4 files changed

+56
-1
lines changed

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"require-dev": {
2020
"phpstan/extension-installer": "^1.4",
2121
"phpstan/phpstan": "^1.12",
22+
"phpstan/phpstan-deprecation-rules": "^1.2",
2223
"phpunit/phpunit": "^9.6",
2324
"symfony/var-dumper": "^5.3",
2425
"thecodingmachine/phpstan-safe-rule": "^1.2",
@@ -39,6 +40,7 @@
3940
},
4041
"scripts": {
4142
"phpstan": "phpstan analyze",
43+
"phpstan-baseline": "phpstan analyse -c phpstan.neon.dist --generate-baseline || true",
4244
"test": "phpunit"
4345
},
4446
"bin": [

lib/FilterApplication.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ private function printResult(array $errors): void
7777
'parameters' => [
7878
'ignoreErrors' => $ignoreErrors,
7979
],
80-
], Neon::BLOCK);
80+
], true);
8181

8282
if (substr($neon, -2) !== "\n\n") {
8383
throw new ShouldNotHappenException();

phpstan-baseline.neon

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: """
5+
#^Call to deprecated function Safe\\\\sprintf\\(\\)\\:
6+
The Safe version of this function is no longer needed in PHP 8\\.0\\+$#
7+
"""
8+
count: 1
9+
path: bin/phpstan-baseline-trend.php
10+
11+
-
12+
message: """
13+
#^Call to deprecated function Safe\\\\substr\\(\\)\\:
14+
The Safe version of this function is no longer needed in PHP 8\\.0\\+$#
15+
"""
16+
count: 1
17+
path: bin/phpstan-baseline-trend.php
18+
19+
-
20+
message: """
21+
#^Call to deprecated function Safe\\\\sprintf\\(\\)\\:
22+
The Safe version of this function is no longer needed in PHP 8\\.0\\+$#
23+
"""
24+
count: 3
25+
path: lib/Baseline.php
26+
27+
-
28+
message: """
29+
#^Call to deprecated function Safe\\\\substr\\(\\)\\:
30+
The Safe version of this function is no longer needed in PHP 8\\.0\\+$#
31+
"""
32+
count: 2
33+
path: lib/FilterApplication.php
34+
35+
-
36+
message: """
37+
#^Call to deprecated function Safe\\\\substr\\(\\)\\:
38+
The Safe version of this function is no longer needed in PHP 8\\.0\\+$#
39+
"""
40+
count: 2
41+
path: lib/FilterConfig.php
42+
43+
-
44+
message: """
45+
#^Call to deprecated function Safe\\\\sprintf\\(\\)\\:
46+
The Safe version of this function is no longer needed in PHP 8\\.0\\+$#
47+
"""
48+
count: 12
49+
path: lib/ResultPrinter.php

phpstan.neon.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
includes:
2+
- phpstan-baseline.neon
3+
14
parameters:
25
level: max
6+
reportUnmatchedIgnoredErrors: false
37

48
paths:
59
- bin/

0 commit comments

Comments
 (0)