Skip to content

Commit 2e36453

Browse files
Update tests
1 parent 6a15618 commit 2e36453

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

src/Type/Traits/ObjectTypeTrait.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use PHPStan\Type\BooleanType;
2020
use PHPStan\Type\ErrorType;
2121
use PHPStan\Type\MixedType;
22-
use PHPStan\Type\StringType;
2322
use PHPStan\Type\Type;
2423
use PHPStan\Type\TypeCombinator;
2524

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,19 @@
99
"line": 16,
1010
"ignorable": true
1111
},
12+
{
13+
"message": "Offset int|object does not exist on array{baz: 21}|array{foo: 17, bar: 19}.",
14+
"line": 55,
15+
"ignorable": true
16+
},
1217
{
1318
"message": "Invalid array key type stdClass.",
1419
"line": 59,
1520
"ignorable": true
21+
},
22+
{
23+
"message": "Offset stdClass does not exist on array{baz: 21}|array{foo: 17, bar: 19}.",
24+
"line": 59,
25+
"ignorable": true
1626
}
17-
]
27+
]

tests/PHPStan/Rules/Arrays/NonexistentOffsetInArrayDimFetchRuleTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ public function testStrings(): void
193193
'Offset 12.34 might not exist on array|string.',
194194
28,
195195
],
196+
[
197+
'Offset int|object might not exist on array|string.',
198+
32,
199+
],
196200
]);
197201
}
198202

@@ -931,7 +935,7 @@ public function testBugObject(): void
931935
[
932936
'Offset object does not exist on array<string, int>.',
933937
21,
934-
]
938+
],
935939
]);
936940
}
937941

0 commit comments

Comments
 (0)