mirror of
https://github.com/danog/psalm-plugin-phpunit.git
synced 2024-11-26 12:04:52 +01:00
Fix
This commit is contained in:
parent
1421076bc8
commit
9044b30475
@ -337,12 +337,12 @@ class TestCaseHandler implements
|
||||
$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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user