Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Nov 1, 2022
1 parent 1421076 commit 9044b30
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Hooks/TestCaseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,12 @@ static function (
$provider_docblock_location
): void {
if ($is_optional) {
if (method_exists($param_type, 'setPossiblyUndefined')) {
/** @var Union */
$param_type = $param_type->setPossiblyUndefined(true);
} else {
if (VersionUtils::packageVersionIs('vimeo/psalm', '<', '5.0')) {
$param_type = clone $param_type;
$param_type->possibly_undefined = true;
} else {
/** @var Union */
$param_type = $param_type->setPossiblyUndefined(true);
}
}
if ($codebase->isTypeContainedByType($potential_argument_type, $param_type)) {
Expand Down

0 comments on commit 9044b30

Please sign in to comment.