Exclude error string from class names (#6279)

This commit is contained in:
Tomas Votruba 2021-05-01 15:24:15 +02:00 committed by GitHub
parent 139c73c5b5
commit 37e07762c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,26 @@
<?php
final class AddErrorString
{
public function get()
{
return ['error' => 100];
}
}
?>
-----
<?php
final class AddErrorString
{
/**
* @return array<string, int>
*/
public function get()
{
return ['error' => 100];
}
}
?>

View File

@ -30,6 +30,11 @@ final class GenericClassStringTypeNormalizer
return $callback($type); return $callback($type);
} }
// skip string that look like classe
if ($type->getValue() === 'error') {
return $callback($type);
}
if (! $this->reflectionProvider->hasClass($type->getValue())) { if (! $this->reflectionProvider->hasClass($type->getValue())) {
return $callback($type); return $callback($type);
} }