Skip to content
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

Fix checking empty constant arrays in array function return type extensions #1696

Merged
merged 1 commit into from Sep 5, 2022

Conversation

rvanvelzen
Copy link
Contributor

@@ -37,8 +37,11 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection,
if (count($constantArrays) > 0) {
$keyTypes = [];
foreach ($constantArrays as $constantArray) {
if ($constantArray->isEmpty()) {
$iterableAtLeastOnce = $constantArray->isIterableAtLeastOnce();
if (!$iterableAtLeastOnce->yes()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The edits in these extensions should be tested too, right :)

@herndlm
Copy link
Contributor

herndlm commented Sep 5, 2022

Oh, did I break this? Thx!

@ondrejmirtes
Copy link
Member

Yeah, I was a bit suspicious because isEmpty() cannot really be a bool, should be a TrinaryLogic, and the bug is caused by that :)

@ondrejmirtes ondrejmirtes merged commit f129659 into phpstan:1.8.x Sep 5, 2022
@ondrejmirtes
Copy link
Member

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants