mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-15 05:15:04 +01:00
Exclude error string from class names (#6279)
This commit is contained in:
parent
139c73c5b5
commit
37e07762c5
@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -30,6 +30,11 @@ final class GenericClassStringTypeNormalizer
|
||||
return $callback($type);
|
||||
}
|
||||
|
||||
// skip string that look like classe
|
||||
if ($type->getValue() === 'error') {
|
||||
return $callback($type);
|
||||
}
|
||||
|
||||
if (! $this->reflectionProvider->hasClass($type->getValue())) {
|
||||
return $callback($type);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user