mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
parent
8494f02008
commit
750d4b4f4f
@ -1041,7 +1041,9 @@ class AssertionReconciler extends \Psalm\Type\Reconciler
|
||||
|
||||
$failed_reconciliation = 2;
|
||||
|
||||
return Type::getMixed();
|
||||
return $existing_var_type->from_docblock
|
||||
? Type::getMixed()
|
||||
: Type::getEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1100,7 +1102,9 @@ class AssertionReconciler extends \Psalm\Type\Reconciler
|
||||
|
||||
$failed_reconciliation = 2;
|
||||
|
||||
return Type::getMixed();
|
||||
return $existing_var_type->from_docblock
|
||||
? Type::getMixed()
|
||||
: Type::getEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1155,7 +1159,9 @@ class AssertionReconciler extends \Psalm\Type\Reconciler
|
||||
|
||||
$failed_reconciliation = 2;
|
||||
|
||||
return Type::getMixed();
|
||||
return $existing_var_type->from_docblock
|
||||
? Type::getMixed()
|
||||
: Type::getEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1220,7 +1226,9 @@ class AssertionReconciler extends \Psalm\Type\Reconciler
|
||||
|
||||
$failed_reconciliation = 2;
|
||||
|
||||
return Type::getMixed();
|
||||
return $existing_var_type->from_docblock
|
||||
? Type::getMixed()
|
||||
: Type::getEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1283,7 +1291,9 @@ class AssertionReconciler extends \Psalm\Type\Reconciler
|
||||
|
||||
$failed_reconciliation = 2;
|
||||
|
||||
return Type::getMixed();
|
||||
return $existing_var_type->from_docblock
|
||||
? Type::getMixed()
|
||||
: Type::getEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1517,7 +1527,9 @@ class AssertionReconciler extends \Psalm\Type\Reconciler
|
||||
|
||||
$failed_reconciliation = 2;
|
||||
|
||||
return Type::getMixed();
|
||||
return $existing_var_type->from_docblock
|
||||
? Type::getMixed()
|
||||
: Type::getEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1591,7 +1603,9 @@ class AssertionReconciler extends \Psalm\Type\Reconciler
|
||||
|
||||
$failed_reconciliation = 2;
|
||||
|
||||
return Type::getMixed();
|
||||
return $existing_var_type->from_docblock
|
||||
? Type::getMixed()
|
||||
: Type::getEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1681,7 +1695,9 @@ class AssertionReconciler extends \Psalm\Type\Reconciler
|
||||
|
||||
$failed_reconciliation = 2;
|
||||
|
||||
return Type::getMixed();
|
||||
return $existing_var_type->from_docblock
|
||||
? Type::getMixed()
|
||||
: Type::getEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2213,6 +2213,15 @@ class ConditionalTest extends \Psalm\Tests\TestCase
|
||||
}
|
||||
}'
|
||||
],
|
||||
'ignoreRedundantAssertion' => [
|
||||
'<?php
|
||||
function gimmeAString(?string $v): string {
|
||||
/** @psalm-suppress TypeDoesNotContainType */
|
||||
assert(is_string($v) || is_object($v));
|
||||
|
||||
return $v;
|
||||
}'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user