Skip to content

Commit a833a94

Browse files
Regenerated PHPStan (#192)
* Regenerated PHPStan * Fixed PHPStan --------- Co-authored-by: Paweł Niedzielski <[email protected]>
1 parent c5f52a8 commit a833a94

File tree

6 files changed

+157
-115
lines changed

6 files changed

+157
-115
lines changed

phpstan-baseline-7.4.neon

Lines changed: 42 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,79 @@
11
parameters:
22
ignoreErrors:
33
-
4-
message: "#^Parameter \\#1 \\$input of function array_slice expects array, iterable\\<int, Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Relation\\> given\\.$#"
4+
message: '#^Access to an undefined property DOMNode\:\:\$data\.$#'
5+
identifier: property.notFound
56
count: 1
6-
path: src/lib/Server/Controller/Content.php
7+
path: src/lib/Input/Handler/Xml.php
78

89
-
9-
message: "#^Parameter \\#2 \\$str of function explode expects string, string\\|null given\\.$#"
10-
count: 4
11-
path: src/lib/Server/Controller/Content.php
10+
message: '#^Access to an undefined property DOMNode\:\:\$tagName\.$#'
11+
identifier: property.notFound
12+
count: 1
13+
path: src/lib/Input/Handler/Xml.php
1214

1315
-
14-
message: "#^Parameter \\#2 \\.\\.\\.\\$args of function array_merge expects array, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\ContentType\\\\ContentType\\> given\\.$#"
16+
message: '#^Access to an undefined property DOMNode\:\:\$wholeText\.$#'
17+
identifier: property.notFound
1518
count: 1
16-
path: src/lib/Server/Controller/ContentType.php
19+
path: src/lib/Input/Handler/Xml.php
1720

1821
-
19-
message: "#^Parameter \\#1 \\$arr1 of function array_merge expects array, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\User\\\\Policy\\> given\\.$#"
22+
message: '#^Parameter \#1 \$domElement of method Ibexa\\Rest\\Input\\Handler\\Xml\:\:parseFieldTypeHash\(\) expects DOMElement, DOMNode given\.$#'
23+
identifier: argument.type
2024
count: 1
21-
path: src/lib/Server/Controller/Role.php
25+
path: src/lib/Input/Handler/Xml.php
2226

2327
-
24-
message: "#^Parameter \\#1 \\$input of function array_slice expects array, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\User\\\\Role\\> given\\.$#"
28+
message: '#^Parameter \#1 \$input of function array_slice expects array, iterable\<int, Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Relation\> given\.$#'
29+
identifier: argument.type
2530
count: 1
26-
path: src/lib/Server/Controller/Role.php
31+
path: src/lib/Server/Controller/Content.php
2732

2833
-
29-
message: "#^Parameter \\#2 \\$error_type of function trigger_error expects int, string given\\.$#"
34+
message: '#^Parameter \#2 \$str of function explode expects string, string\|null given\.$#'
35+
identifier: argument.type
3036
count: 4
31-
path: src/lib/Server/Controller/User.php
37+
path: src/lib/Server/Controller/Content.php
3238

3339
-
34-
message: "#^Parameter \\#1 \\$message of method Psr\\\\Log\\\\LoggerInterface\\:\\:error\\(\\) expects string, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
40+
message: '#^Parameter \#2 \.\.\.\$args of function array_merge expects array, iterable\<Ibexa\\Contracts\\Core\\Repository\\Values\\ContentType\\ContentType\> given\.$#'
41+
identifier: argument.type
3542
count: 1
36-
path: src/lib/Server/Security/RestAuthenticator.php
43+
path: src/lib/Server/Controller/ContentType.php
3744

3845
-
39-
message: "#^Parameter \\#1 \\$str of function base64_encode expects string, string\\|false given\\.$#"
46+
message: '#^Parameter \#1 \$arr1 of function array_merge expects array, iterable\<Ibexa\\Contracts\\Core\\Repository\\Values\\User\\Policy\> given\.$#'
47+
identifier: argument.type
4048
count: 1
41-
path: tests/bundle/Functional/BinaryContentTest.php
49+
path: src/lib/Server/Controller/Role.php
4250

4351
-
44-
message: "#^Parameter \\#2 \\$newvalue of function ini_set expects string, int given\\.$#"
45-
count: 2
46-
path: tests/lib/Output/Generator/FieldTypeHashGeneratorBaseTest.php
52+
message: '#^Parameter \#1 \$input of function array_slice expects array, iterable\<Ibexa\\Contracts\\Core\\Repository\\Values\\User\\Role\> given\.$#'
53+
identifier: argument.type
54+
count: 1
55+
path: src/lib/Server/Controller/Role.php
4756

4857
-
49-
message: '#^Access to an undefined property DOMNode\:\:\$data\.$#'
50-
identifier: property.notFound
51-
count: 1
52-
path: src/lib/Input/Handler/Xml.php
58+
message: '#^Parameter \#2 \$error_type of function trigger_error expects int, string given\.$#'
59+
identifier: argument.type
60+
count: 4
61+
path: src/lib/Server/Controller/User.php
5362

5463
-
55-
message: '#^Access to an undefined property DOMNode\:\:\$tagName\.$#'
56-
identifier: property.notFound
64+
message: '#^Parameter \#1 \$message of method Psr\\Log\\LoggerInterface\:\:error\(\) expects string, Symfony\\Component\\Security\\Core\\User\\UserInterface\|null given\.$#'
65+
identifier: argument.type
5766
count: 1
58-
path: src/lib/Input/Handler/Xml.php
67+
path: src/lib/Server/Security/RestAuthenticator.php
5968

6069
-
61-
message: '#^Access to an undefined property DOMNode\:\:\$wholeText\.$#'
62-
identifier: property.notFound
70+
message: '#^Parameter \#1 \$str of function base64_encode expects string, string\|false given\.$#'
71+
identifier: argument.type
6372
count: 1
64-
path: src/lib/Input/Handler/Xml.php
73+
path: tests/bundle/Functional/BinaryContentTest.php
6574

6675
-
67-
message: '#^Parameter \#1 \$domElement of method Ibexa\\Rest\\Input\\Handler\\Xml\:\:parseFieldTypeHash\(\) expects DOMElement, DOMNode given\.$#'
76+
message: '#^Parameter \#2 \$newvalue of function ini_set expects string, int given\.$#'
6877
identifier: argument.type
69-
count: 1
70-
path: src/lib/Input/Handler/Xml.php
78+
count: 2
79+
path: tests/lib/Output/Generator/FieldTypeHashGeneratorBaseTest.php

phpstan-baseline-8.0.neon

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

phpstan-baseline-gte-8.0.neon

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: '#^Access to an undefined property DOMNode\:\:\$data\.$#'
5+
identifier: property.notFound
6+
count: 2
7+
path: src/lib/Input/Handler/Xml.php
8+
9+
-
10+
message: '#^Access to an undefined property DOMNode\:\:\$tagName\.$#'
11+
identifier: property.notFound
12+
count: 2
13+
path: src/lib/Input/Handler/Xml.php
14+
15+
-
16+
message: '#^Access to an undefined property DOMNode\:\:\$wholeText\.$#'
17+
identifier: property.notFound
18+
count: 2
19+
path: src/lib/Input/Handler/Xml.php
20+
21+
-
22+
message: '#^Call to an undefined method DOMNode\:\:getAttribute\(\)\.$#'
23+
identifier: method.notFound
24+
count: 1
25+
path: src/lib/Input/Handler/Xml.php
26+
27+
-
28+
message: '#^Call to an undefined method DOMNode\:\:hasAttribute\(\)\.$#'
29+
identifier: method.notFound
30+
count: 1
31+
path: src/lib/Input/Handler/Xml.php
32+
33+
-
34+
message: '#^Parameter \#1 \$domElement of method Ibexa\\Rest\\Input\\Handler\\Xml\:\:parseFieldTypeHash\(\) expects DOMElement, DOMNode given\.$#'
35+
identifier: argument.type
36+
count: 1
37+
path: src/lib/Input/Handler/Xml.php
38+
39+
-
40+
message: '#^Parameter \#1 \$array of function array_slice expects array, iterable\<int, Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Relation\> given\.$#'
41+
identifier: argument.type
42+
count: 1
43+
path: src/lib/Server/Controller/Content.php
44+
45+
-
46+
message: '#^Parameter \#2 \$string of function explode expects string, string\|null given\.$#'
47+
identifier: argument.type
48+
count: 4
49+
path: src/lib/Server/Controller/Content.php
50+
51+
-
52+
message: '#^Parameter \#2 \.\.\.\$arrays of function array_merge expects array, iterable\<Ibexa\\Contracts\\Core\\Repository\\Values\\ContentType\\ContentType\> given\.$#'
53+
identifier: argument.type
54+
count: 1
55+
path: src/lib/Server/Controller/ContentType.php
56+
57+
-
58+
message: '#^Parameter \#1 \$array of function array_slice expects array, iterable\<Ibexa\\Contracts\\Core\\Repository\\Values\\User\\Role\> given\.$#'
59+
identifier: argument.type
60+
count: 1
61+
path: src/lib/Server/Controller/Role.php
62+
63+
-
64+
message: '#^Parameter \#1 \.\.\.\$arrays of function array_merge expects array, iterable\<Ibexa\\Contracts\\Core\\Repository\\Values\\User\\Policy\> given\.$#'
65+
identifier: argument.type
66+
count: 1
67+
path: src/lib/Server/Controller/Role.php
68+
69+
-
70+
message: '#^Parameter \#2 \$error_level of function trigger_error expects int, string given\.$#'
71+
identifier: argument.type
72+
count: 4
73+
path: src/lib/Server/Controller/User.php
74+
75+
-
76+
message: '#^Parameter \#1 \$message of method Psr\\Log\\LoggerInterface\:\:error\(\) expects string\|Stringable, Symfony\\Component\\Security\\Core\\User\\UserInterface\|null given\.$#'
77+
identifier: argument.type
78+
count: 1
79+
path: src/lib/Server/Security/RestAuthenticator.php
80+
81+
-
82+
message: '#^Parameter \#1 \$string of function base64_encode expects string, string\|false given\.$#'
83+
identifier: argument.type
84+
count: 1
85+
path: tests/bundle/Functional/BinaryContentTest.php

phpstan-baseline-gte-8.1.neon

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: '#^Strict comparison using \!\=\= between DOMNamedNodeMap and null will always evaluate to true\.$#'
5+
identifier: notIdentical.alwaysTrue
6+
count: 1
7+
path: src/lib/Input/Handler/Xml.php

phpstan-baseline.neon

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -792,12 +792,6 @@ parameters:
792792
count: 1
793793
path: src/lib/Input/Handler/Json.php
794794

795-
-
796-
message: '#^Cannot assign new offset to array\|string\.$#'
797-
identifier: offsetAssign.dimType
798-
count: 1
799-
path: src/lib/Input/Handler/Xml.php
800-
801795
-
802796
message: '#^Method Ibexa\\Rest\\Input\\Handler\\Xml\:\:convert\(\) return type has no value type specified in iterable type array\.$#'
803797
identifier: missingType.iterableValue
@@ -811,7 +805,7 @@ parameters:
811805
path: src/lib/Input/Handler/Xml.php
812806

813807
-
814-
message: '#^Method Ibexa\\Rest\\Input\\Handler\\Xml\:\:convertDom\(\) should return array but returns array\<array\|string\|null\>\|string\.$#'
808+
message: '#^Method Ibexa\\Rest\\Input\\Handler\\Xml\:\:convertDom\(\) should return array but returns array\|string\.$#'
815809
identifier: return.type
816810
count: 1
817811
path: src/lib/Input/Handler/Xml.php
@@ -3090,6 +3084,12 @@ parameters:
30903084
count: 1
30913085
path: src/lib/Server/Input/Parser/FacetBuilder/FieldParser.php
30923086

3087+
-
3088+
message: '#^Parameter \#1 \$properties of class Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Query\\FacetBuilder\\FieldFacetBuilder constructor expects array\<string, mixed\>, hasOffsetValue\(string, int\) given\.$#'
3089+
identifier: argument.type
3090+
count: 1
3091+
path: src/lib/Server/Input/Parser/FacetBuilder/FieldParser.php
3092+
30933093
-
30943094
message: '#^Method Ibexa\\Rest\\Server\\Input\\Parser\\FacetBuilder\\FieldRangeParser\:\:parse\(\) has parameter \$data with no value type specified in iterable type array\.$#'
30953095
identifier: missingType.iterableValue
@@ -7188,6 +7188,12 @@ parameters:
71887188
count: 1
71897189
path: tests/bundle/Functional/SessionTest.php
71907190

7191+
-
7192+
message: '#^Argument of an invalid type array\<SimpleXMLElement\>\|null supplied for foreach, only iterables are supported\.$#'
7193+
identifier: foreach.nonIterable
7194+
count: 1
7195+
path: tests/bundle/Functional/SortClauseTest.php
7196+
71917197
-
71927198
message: '#^Method Ibexa\\Tests\\Bundle\\Rest\\Functional\\SortClauseTest\:\:sortingClauseDataProvider\(\) has no return type specified\.$#'
71937199
identifier: missingType.return

phpstan-baseline.neon.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,22 @@
77
declare(strict_types=1);
88

99
$includes = [];
10-
if (PHP_VERSION_ID < 80000) {
10+
if (PHP_VERSION_ID < 8_00_00) {
1111
$includes[] = __DIR__ . '/phpstan-baseline-7.4.neon';
12-
} else {
13-
$includes[] = __DIR__ . '/phpstan-baseline-8.0.neon';
1412
}
1513

16-
if (PHP_VERSION_ID > 80000 && PHP_VERSION_ID < 80100) {
14+
if (PHP_VERSION_ID >= 8_00_00) {
15+
$includes[] = __DIR__ . '/phpstan-baseline-gte-8.0.neon';
16+
}
17+
18+
if (PHP_VERSION_ID >= 8_00_00 && PHP_VERSION_ID < 8_01_00) {
1719
$includes[] = __DIR__ . '/phpstan-baseline-8.0-specific.neon';
1820
}
1921

22+
if (PHP_VERSION_ID >= 8_01_00) {
23+
$includes[] = __DIR__ . '/phpstan-baseline-gte-8.1.neon';
24+
}
25+
2026
$config = [];
2127
$config['includes'] = $includes;
2228

0 commit comments

Comments
 (0)