Skip to content

Commit 2417411

Browse files
Fix tests
1 parent 51c9e6d commit 2417411

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

tests/PHPStan/Levels/data/stringOffsetAccess-7.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
[
2+
{
3+
"message": "Offset int|object might not exist on 'foo'.",
4+
"line": 19,
5+
"ignorable": true
6+
},
27
{
38
"message": "Offset 'foo' might not exist on array|string.",
49
"line": 27,
@@ -9,11 +14,21 @@
914
"line": 31,
1015
"ignorable": true
1116
},
17+
{
18+
"message": "Offset int|object might not exist on array|string.",
19+
"line": 35,
20+
"ignorable": true
21+
},
1222
{
1323
"message": "Possibly invalid array key type int|object.",
1424
"line": 35,
1525
"ignorable": true
1626
},
27+
{
28+
"message": "Offset int|object might not exist on array{baz: 21}|array{foo: 17, bar: 19}.",
29+
"line": 55,
30+
"ignorable": true
31+
},
1732
{
1833
"message": "Possibly invalid array key type int|object.",
1934
"line": 55,

tests/PHPStan/Rules/Arrays/NonexistentOffsetInArrayDimFetchRuleTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ public function testStrings(): void
193193
'Offset 12.34 does not exist on \'foo\'.',
194194
13,
195195
],
196+
[
197+
'Offset int|object might not exist on \'foo\'.',
198+
16,
199+
],
196200
[
197201
'Offset \'foo\' might not exist on array|string.',
198202
24,
@@ -201,6 +205,10 @@ public function testStrings(): void
201205
'Offset 12.34 might not exist on array|string.',
202206
28,
203207
],
208+
[
209+
'Offset int|object might not exist on array|string.',
210+
32,
211+
],
204212
]);
205213
}
206214

0 commit comments

Comments
 (0)