-
Notifications
You must be signed in to change notification settings - Fork 529
Fix hasOffsetValueType for arrays #4277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,10 +18,5 @@ | |
"message": "Invalid array key type stdClass.", | ||
"line": 59, | ||
"ignorable": true | ||
}, | ||
{ | ||
"message": "Offset stdClass does not exist on array{baz: 21}|array{foo: 17, bar: 19}.", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're losing these useful errors. What are they replaced with? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is already (above)
|
||
"line": 59, | ||
"ignorable": true | ||
} | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -193,10 +193,6 @@ public function testStrings(): void | |
'Offset 12.34 might not exist on array|string.', | ||
28, | ||
], | ||
[ | ||
'Offset int|object might not exist on array|string.', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This error was added by #4272 It make sens to not have it since
|
||
32, | ||
], | ||
]); | ||
} | ||
|
||
|
@@ -932,10 +928,6 @@ public function testBugObject(): void | |
'Offset int|object does not exist on array{baz: 21}|array{foo: 17, bar: 19}.', | ||
12, | ||
], | ||
[ | ||
'Offset object does not exist on array<string, int>.', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same, already reported by InvalidArrayOffsetRule and this was added by #4272 |
||
21, | ||
], | ||
]); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace BugDoctrine; | ||
|
||
class HelloWorld | ||
{ | ||
/** | ||
* @param string|array $a | ||
* @param array $b | ||
*/ | ||
public function sayHello($a, $b): void | ||
{ | ||
$b[$a] ?? 2; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change revert the one in #4272