Skip to content

Commit 0f1e13f

Browse files
author
Mateusz Dębiński
committed
Corrected PHPStan
1 parent c880658 commit 0f1e13f

File tree

4 files changed

+91
-12
lines changed

4 files changed

+91
-12
lines changed

ignore-gte-php8.0-errors.neon

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
parameters:
22
ignoreErrors:
3-
-
4-
message: "#^Parameter \\#1 \\$string of function substr expects string, string\\|null given\\.$#"
5-
count: 2
6-
path: src/lib/RichText/Converter/Render/Embed.php
7-
83
-
94
message: "#^Parameter \\#1 \\$string of function trim expects string, string\\|false given\\.$#"
105
count: 1
116
path: src/lib/RichText/Converter/Render/Template.php
7+
8+
-
9+
message: '#^Parameter \#2 \$child of method DOMNode\:\:replaceChild\(\) expects DOMNode, DOMNameSpaceNode\|DOMNode given\.$#'
10+
identifier: argument.type
11+
count: 1
12+
path: src/lib/RichText/XMLSanitizer.php

ignore-gte-php8.1-errors.neon

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ parameters:
66
count: 1
77
path: src/lib/RichText/TextExtractor/FullTextExtractor.php
88

9-
-
10-
message: '#^Parameter \#2 \$child of method DOMNode\:\:replaceChild\(\) expects TNode of DOMNode, DOMNameSpaceNode\|DOMNode given\.$#'
11-
identifier: argument.type
12-
count: 1
13-
path: src/lib/RichText/XMLSanitizer.php
14-
159
-
1610
message: '#^Cannot call method removeChild\(\) on DOMNode\|null\.$#'
1711
identifier: method.nonObject

ignore-lte-php7.4-errors.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
parameters:
22
ignoreErrors:
33
-
4-
message: "#^Parameter \\#1 \\$string of function substr expects string, string\\|false\\|null given\\.$#"
4+
message: "#^Parameter \\#1 \\$string of function substr expects string, string\\|false given\\.$#"
55
count: 2
66
path: src/lib/RichText/Converter/Render/Embed.php
77

phpstan-baseline.neon

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,42 @@ parameters:
552552
count: 1
553553
path: src/lib/FieldType/RichText/RichTextStorage.php
554554

555+
-
556+
message: '#^Offset 1 might not exist on array\{\}\|list\{0\: non\-falsy\-string, 1\?\: string, 2\?\: string\}\.$#'
557+
identifier: offsetAccess.notFound
558+
count: 1
559+
path: src/lib/FieldType/RichText/RichTextStorage.php
560+
561+
-
562+
message: '#^Offset 1 might not exist on array\{\}\|list\{0\: string, 1\?\: ''''\|''ezremote\://'', 2\?\: string, 3\?\: string\}\.$#'
563+
identifier: offsetAccess.notFound
564+
count: 1
565+
path: src/lib/FieldType/RichText/RichTextStorage.php
566+
567+
-
568+
message: '#^Offset 2 might not exist on array\{\}\|list\{0\: non\-falsy\-string, 1\?\: string, 2\?\: string\}\.$#'
569+
identifier: offsetAccess.notFound
570+
count: 1
571+
path: src/lib/FieldType/RichText/RichTextStorage.php
572+
573+
-
574+
message: '#^Offset 2 might not exist on array\{\}\|list\{0\: string, 1\?\: ''''\|''ezremote\://'', 2\?\: string, 3\?\: string\}\.$#'
575+
identifier: offsetAccess.notFound
576+
count: 2
577+
path: src/lib/FieldType/RichText/RichTextStorage.php
578+
579+
-
580+
message: '#^Offset 2 might not exist on list\{0\: string, 1\: ''ezremote\://'', 2\?\: string, 3\?\: string\}\.$#'
581+
identifier: offsetAccess.notFound
582+
count: 1
583+
path: src/lib/FieldType/RichText/RichTextStorage.php
584+
585+
-
586+
message: '#^Offset 3 might not exist on array\{\}\|list\{0\: string, 1\?\: ''''\|''ezremote\://'', 2\?\: string, 3\?\: string\}\.$#'
587+
identifier: offsetAccess.notFound
588+
count: 1
589+
path: src/lib/FieldType/RichText/RichTextStorage.php
590+
555591
-
556592
message: '#^Parameter \#1 \$source of method DOMDocument\:\:loadXML\(\) expects string, array\|bool\|float\|int\|string\|null given\.$#'
557593
identifier: argument.type
@@ -756,6 +792,24 @@ parameters:
756792
count: 1
757793
path: src/lib/RichText/Converter/Link.php
758794

795+
-
796+
message: '#^Offset 1 might not exist on array\{\}\|list\{0\: string, 1\?\: string, 2\?\: string, 3\?\: string\}\.$#'
797+
identifier: offsetAccess.notFound
798+
count: 1
799+
path: src/lib/RichText/Converter/Link.php
800+
801+
-
802+
message: '#^Offset 2 might not exist on array\{\}\|list\{0\: string, 1\?\: string, 2\?\: string, 3\?\: string\}\.$#'
803+
identifier: offsetAccess.notFound
804+
count: 1
805+
path: src/lib/RichText/Converter/Link.php
806+
807+
-
808+
message: '#^Offset 3 might not exist on array\{\}\|list\{0\: string, 1\?\: string, 2\?\: string, 3\?\: string\}\.$#'
809+
identifier: offsetAccess.notFound
810+
count: 1
811+
path: src/lib/RichText/Converter/Link.php
812+
759813
-
760814
message: '#^Parameter \#1 \$locationId of method Ibexa\\Contracts\\Core\\Repository\\LocationService\:\:loadLocation\(\) expects int, int\|null given\.$#'
761815
identifier: argument.type
@@ -936,6 +990,12 @@ parameters:
936990
count: 1
937991
path: src/lib/RichText/Converter/Render/Embed.php
938992

993+
-
994+
message: '#^Offset 1 might not exist on array\{\}\|array\{non\-falsy\-string, ''ezcontent''\|''ezlocation'', numeric\-string\}\.$#'
995+
identifier: offsetAccess.notFound
996+
count: 1
997+
path: src/lib/RichText/Converter/Render/Embed.php
998+
939999
-
9401000
message: '#^PHPDoc tag @var has invalid value \(\$embed \\DOMElement\)\: Unexpected token "\$embed", expected type at offset 9 on line 1$#'
9411001
identifier: phpDoc.parseError
@@ -1146,6 +1206,18 @@ parameters:
11461206
count: 1
11471207
path: src/lib/RichText/RelationProcessor.php
11481208

1209+
-
1210+
message: '#^Offset 1 might not exist on array\{\}\|list\{0\: non\-falsy\-string, 1\: non\-empty\-string, 2\?\: string, 3\?\: string\}\.$#'
1211+
identifier: offsetAccess.notFound
1212+
count: 1
1213+
path: src/lib/RichText/RelationProcessor.php
1214+
1215+
-
1216+
message: '#^Offset 2 might not exist on array\{\}\|list\{0\: non\-falsy\-string, 1\: non\-empty\-string, 2\?\: string, 3\?\: string\}\.$#'
1217+
identifier: offsetAccess.notFound
1218+
count: 1
1219+
path: src/lib/RichText/RelationProcessor.php
1220+
11491221
-
11501222
message: '#^Cannot call method error\(\) on Psr\\Log\\LoggerInterface\|null\.$#'
11511223
identifier: method.nonObject
@@ -1278,6 +1350,18 @@ parameters:
12781350
count: 1
12791351
path: src/lib/RichText/Validator/InternalLinkValidator.php
12801352

1353+
-
1354+
message: '#^Offset 1 might not exist on array\{\}\|list\{0\: non\-falsy\-string, 1\: non\-empty\-string, 2\?\: string, 3\?\: string\}\.$#'
1355+
identifier: offsetAccess.notFound
1356+
count: 1
1357+
path: src/lib/RichText/Validator/InternalLinkValidator.php
1358+
1359+
-
1360+
message: '#^Offset 2 might not exist on array\{\}\|list\{0\: non\-falsy\-string, 1\: non\-empty\-string, 2\?\: string, 3\?\: string\}\.$#'
1361+
identifier: offsetAccess.notFound
1362+
count: 1
1363+
path: src/lib/RichText/Validator/InternalLinkValidator.php
1364+
12811365
-
12821366
message: '#^PHPDoc tag @var has invalid value \(\\Ibexa\\Contracts\\Core\\Persistence\\Content\\Location\\Handler;\)\: Unexpected token ";", expected TOKEN_HORIZONTAL_WS at offset 74 on line 2$#'
12831367
identifier: phpDoc.parseError

0 commit comments

Comments
 (0)