Skip to content

Commit

Permalink
fix "days" ignore falsable return not ignored correctly
Browse files Browse the repository at this point in the history
see Reflection.php, where the same condition was used already, but was insufficient
  • Loading branch information
kkmuffme committed Jul 6, 2023
1 parent 8fe1f15 commit 9fd5906
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -839,10 +839,15 @@ public function finish(PhpParser\Node\Stmt\ClassLike $node): ClassLikeStorage
$classlike_storage->properties[$property_name] = new PropertyStorage();
}

$classlike_storage->properties[$property_name]->type = $property_type;

$property_id = $fq_classlike_name . '::$' . $property_name;

if ($property_id === 'DateInterval::$days') {
/** @psalm-suppress InaccessibleProperty We just parsed this type */
$property_type->ignore_falsable_issues = true;
}

$classlike_storage->properties[$property_name]->type = $property_type;

$classlike_storage->declaring_property_ids[$property_name] = $fq_classlike_name;
$classlike_storage->appearing_property_ids[$property_name] = $property_id;
}
Expand Down

0 comments on commit 9fd5906

Please sign in to comment.