mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-06 19:30:50 +00:00
fix: ignore specified words while making it singularized (#1222)
This commit is contained in:
parent
305c524662
commit
a26ed1a989
|
@ -105,7 +105,13 @@ final class InflectorSingularResolver
|
|||
|
||||
$resolvedName = '';
|
||||
foreach ($camelCases as $camelCase) {
|
||||
$resolvedName .= $this->inflector->singularize($camelCase['camelcase']);
|
||||
$value = $this->inflector->singularize($camelCase['camelcase']);
|
||||
|
||||
if (in_array($camelCase['camelcase'], ['is', 'has'])) {
|
||||
$value = $camelCase['camelcase'];
|
||||
}
|
||||
|
||||
$resolvedName .= $value;
|
||||
}
|
||||
|
||||
return $resolvedName;
|
||||
|
|
|
@ -39,5 +39,6 @@ final class InflectorSingularResolverTest extends AbstractTestCase
|
|||
// news and plural
|
||||
yield ['staticCallsToNews', 'staticCallToNew'];
|
||||
yield ['newsToMethodCalls', 'newToMethodCall'];
|
||||
yield ['hasFilters', 'hasFilter'];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user