mirror of
https://github.com/danog/psalm-plugin-phpunit.git
synced 2024-11-30 04:29:08 +01:00
Immutable refactoring
This commit is contained in:
parent
5a66a0a7c2
commit
803eb8585f
@ -164,8 +164,7 @@ class TestCaseHandler implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($specials['dataProvider'] as $line => $provider) {
|
foreach ($specials['dataProvider'] as $line => $provider) {
|
||||||
$provider_docblock_location = clone $method_storage->location;
|
$provider_docblock_location = $method_storage->location->setCommentLine($line);
|
||||||
$provider_docblock_location->setCommentLine($line);
|
|
||||||
|
|
||||||
if (false !== strpos($provider, '::')) {
|
if (false !== strpos($provider, '::')) {
|
||||||
[$class_name, $method_id] = explode('::', $provider);
|
[$class_name, $method_id] = explode('::', $provider);
|
||||||
@ -328,9 +327,8 @@ class TestCaseHandler implements
|
|||||||
$provider_return_type_string,
|
$provider_return_type_string,
|
||||||
$provider_docblock_location
|
$provider_docblock_location
|
||||||
): void {
|
): void {
|
||||||
$param_type = clone $param_type;
|
|
||||||
if ($is_optional) {
|
if ($is_optional) {
|
||||||
$param_type->possibly_undefined = true;
|
$param_type = $param_type->setPossiblyUndefined(true);
|
||||||
}
|
}
|
||||||
if ($codebase->isTypeContainedByType($potential_argument_type, $param_type)) {
|
if ($codebase->isTypeContainedByType($potential_argument_type, $param_type)) {
|
||||||
// ok
|
// ok
|
||||||
|
Loading…
Reference in New Issue
Block a user