Skip to content

Commit 868c475

Browse files
authored
[PHPStan] Fixed PHPStan baseline (#371)
For more details see #371 * [PHPStan] Aligned baseline after PHPStan update * [PHPStan] Moved inlined PHP < 8.2 issue to the proper baseline file * [PHPStan] Moved PHP < 8.3 issues from the main baseline file * [PHPStan] Renamed baseline file for PHP >= 8.0
1 parent 63492be commit 868c475

File tree

6 files changed

+60
-6
lines changed

6 files changed

+60
-6
lines changed
File renamed without changes.

phpstan-baseline-lte-8.1.neon

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: "#^Class SensitiveParameterValue not found\\.$#"
5+
count: 1
6+
path: tests/lib/Repository/User/PasswordHashServiceTest.php

phpstan-baseline-lte-8.2.neon

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: "#^Offset 'uri' does not exist on array\\{timed_out\\: bool, blocked\\: bool, eof\\: bool, unread_bytes\\: int, stream_type\\: string, wrapper_type\\: string, wrapper_data\\: mixed, mode\\: string, \\.\\.\\.\\}\\.$#"
5+
count: 1
6+
path: src/bundle/Core/Imagine/IORepositoryResolver.php
7+
8+
-
9+
message: "#^Offset 'uri' does not exist on array\\{timed_out\\: bool, blocked\\: bool, eof\\: bool, unread_bytes\\: int, stream_type\\: string, wrapper_type\\: string, wrapper_data\\: mixed, mode\\: string, \\.\\.\\.\\}\\.$#"
10+
count: 1
11+
path: src/bundle/Core/Imagine/PlaceholderProvider/GenericProvider.php
12+
13+
-
14+
message: "#^Offset 'uri' does not exist on array\\{timed_out\\: bool, blocked\\: bool, eof\\: bool, unread_bytes\\: int, stream_type\\: string, wrapper_type\\: string, wrapper_data\\: mixed, mode\\: string, \\.\\.\\.\\}\\.$#"
15+
count: 1
16+
path: src/bundle/Core/Imagine/PlaceholderProvider/RemoteProvider.php
17+
18+
-
19+
message: "#^Offset 'uri' does not exist on array\\{timed_out\\: bool, blocked\\: bool, eof\\: bool, unread_bytes\\: int, stream_type\\: string, wrapper_type\\: string, wrapper_data\\: mixed, mode\\: string, \\.\\.\\.\\}\\.$#"
20+
count: 1
21+
path: src/bundle/Core/Command/ResizeOriginalImagesCommand.php

phpstan-baseline.neon

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ parameters:
230230
count: 1
231231
path: src/bundle/Core/Command/RegenerateUrlAliasesCommand.php
232232

233+
-
234+
message: "#^Cannot access offset int on iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Content\\>\\.$#"
235+
count: 1
236+
path: src/bundle/Core/Command/RegenerateUrlAliasesCommand.php
237+
233238
-
234239
message: "#^Method Ibexa\\\\Bundle\\\\Core\\\\Command\\\\RegenerateUrlAliasesCommand\\:\\:configure\\(\\) has no return type specified\\.$#"
235240
count: 1
@@ -3687,7 +3692,7 @@ parameters:
36873692

36883693
-
36893694
message: "#^Cannot access offset string on Ibexa\\\\Bundle\\\\Core\\\\Imagine\\\\PlaceholderProvider\\.$#"
3690-
count: 2
3695+
count: 3
36913696
path: src/bundle/Core/Imagine/PlaceholderProviderRegistry.php
36923697

36933698
-
@@ -14952,12 +14957,12 @@ parameters:
1495214957

1495314958
-
1495414959
message: "#^Cannot access offset int\\|string on Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\Field\\.$#"
14955-
count: 1
14960+
count: 3
1495614961
path: src/lib/Persistence/Legacy/Content/FieldHandler.php
1495714962

1495814963
-
1495914964
message: "#^Cannot access offset string on Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\Field\\.$#"
14960-
count: 2
14965+
count: 5
1496114966
path: src/lib/Persistence/Legacy/Content/FieldHandler.php
1496214967

1496314968
-
@@ -20195,6 +20200,11 @@ parameters:
2019520200
count: 1
2019620201
path: src/lib/Repository/Mapper/ContentDomainMapper.php
2019720202

20203+
-
20204+
message: "#^Cannot access offset mixed on iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\>\\.$#"
20205+
count: 1
20206+
path: src/lib/Repository/Mapper/ContentDomainMapper.php
20207+
2019820208
-
2019920209
message: "#^Cannot call method error\\(\\) on Psr\\\\Log\\\\LoggerInterface\\|null\\.$#"
2020020210
count: 1
@@ -23082,7 +23092,7 @@ parameters:
2308223092

2308323093
-
2308423094
message: "#^Cannot access offset string on iterable\\<string, Ibexa\\\\Contracts\\\\Core\\\\Variation\\\\VariationHandler\\>\\.$#"
23085-
count: 2
23095+
count: 3
2308623096
path: src/lib/Variation/VariationHandlerRegistry.php
2308723097

2308823098
-
@@ -27340,6 +27350,11 @@ parameters:
2734027350
count: 1
2734127351
path: tests/integration/Core/Repository/ContentServiceTest.php
2734227352

27353+
-
27354+
message: "#^Cannot access offset mixed on iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\VersionInfo\\>\\.$#"
27355+
count: 1
27356+
path: tests/integration/Core/Repository/ContentServiceTest.php
27357+
2734327358
-
2734427359
message: "#^Cannot access property \\$sortField on Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Location\\|null\\.$#"
2734527360
count: 1
@@ -57985,6 +58000,11 @@ parameters:
5798558000
count: 3
5798658001
path: tests/lib/Repository/Service/Mock/ContentTest.php
5798758002

58003+
-
58004+
message: "#^Cannot access offset mixed on Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Field\\.$#"
58005+
count: 1
58006+
path: tests/lib/Repository/Service/Mock/ContentTest.php
58007+
5798858008
-
5798958009
message: "#^Cannot access offset string on Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Field\\.$#"
5799058010
count: 1

phpstan-baseline.neon.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@
1010
if (PHP_VERSION_ID < 80000) {
1111
$includes[] = __DIR__ . '/phpstan-baseline-7.4.neon';
1212
} else {
13-
$includes[] = __DIR__ . '/phpstan-baseline-8.0.neon';
13+
$includes[] = __DIR__ . '/phpstan-baseline-gte-8.0.neon';
14+
}
15+
16+
if (PHP_VERSION_ID < 80200) {
17+
$includes[] = __DIR__ . '/phpstan-baseline-lte-8.1.neon';
18+
}
19+
20+
if (PHP_VERSION_ID < 80300) {
21+
$includes[] = __DIR__ . '/phpstan-baseline-lte-8.2.neon';
1422
}
1523

1624
$config = [];

tests/lib/Repository/User/PasswordHashServiceTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ public function testCreatePasswordHashExceptionHidesSensitiveParameter(): void
7070
if (\PHP_VERSION_ID < 80200) {
7171
self::assertEquals($password, $stackTrace[0]['args'][0]);
7272
} else {
73-
// @phpstan-ignore-next-line This class is PHP 8.2+ only, but older PHP never reaches this else-block.
7473
self::assertInstanceOf(\SensitiveParameterValue::class, $stackTrace[0]['args'][0]);
7574
}
7675
}

0 commit comments

Comments
 (0)