Skip to content

Commit eb963d8

Browse files
Copilotvoku
andauthored
Initial analysis of deprecated PHP patterns
Agent-Logs-Url: https://github.com/voku/Arrayy/sessions/da9c69db-a7c6-4b52-aead-672148477a67 Co-authored-by: voku <264695+voku@users.noreply.github.com>
1 parent e88173f commit eb963d8

3 files changed

Lines changed: 35 additions & 3 deletions

File tree

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"phpdocumentor/reflection-docblock": "~4.3 || ~5.0"
2727
},
2828
"require-dev": {
29-
"phpunit/phpunit": "~6.0 || ~7.0 || ~9.0"
29+
"phpunit/phpunit": "~6.0 || ~7.0 || ~9.0",
30+
"phpstan/phpstan": "*"
3031
},
3132
"support": {
3233
"docs": "https://voku.github.io/Arrayy/",

phpstan.neon

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
parameters:
22
level: 8
33
reportUnmatchedIgnoredErrors: false
4-
checkGenericClassInNonGenericObjectType: true
5-
checkMissingIterableValueType: false
64
paths:
75
- %currentWorkingDirectory%/src/
86
- %currentWorkingDirectory%/tests/

phpstan.neon.bak

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
parameters:
2+
level: 8
3+
reportUnmatchedIgnoredErrors: false
4+
checkGenericClassInNonGenericObjectType: true
5+
checkMissingIterableValueType: false
6+
paths:
7+
- %currentWorkingDirectory%/src/
8+
- %currentWorkingDirectory%/tests/
9+
ignoreErrors:
10+
-
11+
message: ~has no return type specified~
12+
path: %currentWorkingDirectory%/tests/*
13+
-
14+
message: '#assertContains|assertInternalType|assertStringContainsString|assertIsArray|expectExceptionMessage#'
15+
path: %currentWorkingDirectory%/tests/*
16+
-
17+
message: ~Call to an undefined static method~
18+
path: %currentWorkingDirectory%/tests/StaticArrayyTest.php
19+
# false-positive?
20+
- '/function call_user_func expects callable.*array\{.*\} given/'
21+
- '/function call_user_func_array expects callable.*array\{.*\} given/'
22+
- '/\(array<TKey of \(int\|string\), T>\) does not accept array<TKey of \(int\|string\)/'
23+
- '/\(array<TKey of \(int\|string\), T>\) does not accept array<int, T>/'
24+
- '/\(array<TKey of \(int\|string\), T>\) does not accept array<int\|string, T>/'
25+
- '/array_map expects \(callable\(mixed\):/'
26+
# ignore gernal errors
27+
- '/Unsafe usage of new static/'
28+
- '/should be compatible with return type \(bool\) of method ArrayObject/'
29+
# ignore Iterator stuff
30+
- '/__construct\(\) has parameter \$iteratorClass with generic/'
31+
- '/create\(\) has parameter \$iteratorClass with generic/'
32+
- '/parameter \$iteratorClass with generic class Arrayy\\ArrayyIterator/'
33+
- '/generic class Arrayy\\ArrayyIterator does not specify its types/'

0 commit comments

Comments
 (0)