Immutable refactoring

This commit is contained in:
Daniil Gentili 2022-10-22 22:17:19 +02:00
parent 5a66a0a7c2
commit 803eb8585f

View File

@ -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