Skip to content

Commit

Permalink
feat: change isOffsetAccessLegal to maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
rajyan committed May 11, 2024
1 parent a23a9f8 commit de8660d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Type/StrictMixedType.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ public function isOffsetAccessLegal(): TrinaryLogic
return TrinaryLogic::createYes();
}
}
return TrinaryLogic::createNo();
return TrinaryLogic::createMaybe();
}

public function hasOffsetValueType(Type $offsetType): TrinaryLogic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ public function testBug7229(): void
[
'Cannot access offset string on mixed.',
24,
'To offset access on this value, narrow down the type by filtering classes not implementing ArrayAccess::class.',
],
]);
}
Expand Down Expand Up @@ -732,6 +733,7 @@ public function testBug9991(): void
[
'Cannot access offset \'title\' on mixed.',
9,
'To offset access on this value, narrow down the type by filtering classes not implementing ArrayAccess::class.',
],
]);
}
Expand Down Expand Up @@ -775,6 +777,7 @@ public function testMixed(): void
[
'Cannot access offset 5 on T of mixed.',
12,
'To offset access on this value, narrow down the type by filtering classes not implementing ArrayAccess::class.',
],
[
'Cannot access offset 5 on T of mixed.',
Expand All @@ -787,6 +790,7 @@ public function testMixed(): void
[
'Cannot access offset 5 on mixed.',
25,
'To offset access on this value, narrow down the type by filtering classes not implementing ArrayAccess::class.',
],
[
'Cannot access offset 5 on mixed.',
Expand All @@ -799,6 +803,7 @@ public function testMixed(): void
[
'Cannot access offset 5 on mixed.',
38,
'To offset access on this value, narrow down the type by filtering classes not implementing ArrayAccess::class.',
],
[
'Cannot access offset 5 on mixed.',
Expand Down

0 comments on commit de8660d

Please sign in to comment.