Skip to content

Commit

Permalink
Merge pull request #9998 from kkmuffme/days-property-remove-false-type
Browse files Browse the repository at this point in the history
Fix "days" falsable return not ignored consistently
  • Loading branch information
orklah committed Jul 6, 2023
2 parents 8fe1f15 + 9fd5906 commit ae19418
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 ae19418

Please sign in to comment.