src/Sniffs/Naming/ClassNameSuffixByParentSniff.php
private function resolveExpectedSuffix(string $parentType): string
    {
        if (Strings::endsWith($parentType, 'Interface')) {
            $parentType = Strings::substring($parentType, 0, -strlen('Interface'));
        }

        if (Strings::endsWith($parentType, 'Abstract')) {
            $parentType = Strings::substring($parentType, 0, -strlen('Abstract'));
        }

        if (Strings::startsWith($parentType, 'Abstract')) {
            $parentType = Strings::substring($parentType, strlen('Abstract'));
        }

        return $parentType;
    }
private function resolveExpectedSuffix(string $parentType): string
    {
        if (Strings::endsWith($parentType, 'Interface')) {
            $parentType = Strings::substring($parentType, 0, -strlen('Interface'));
        }

        if (Strings::endsWith($parentType, 'Abstract')) {
            $parentType = Strings::substring($parentType, 0, -strlen('Abstract'));
        }

        if (Strings::startsWith($parentType, 'Abstract')) {
            $parentType = Strings::substring($parentType, strlen('Abstract'));
        }

        return $parentType;
    }
private function resolveExpectedSuffix ( string $ parentType ) : string { if ( Strings :: endsWith ( $ parentType , 'Interface' ) ) { $ parentType = Strings :: substring ( $ parentType , 0 , - strlen ( 'Interface' ) ) ; } if ( Strings :: endsWith ( $ parentType , 'Abstract' ) ) { $ parentType = Strings :: substring ( $ parentType , 0 , - strlen ( 'Abstract' ) ) ; } if ( Strings :: startsWith ( $ parentType , 'Abstract' ) ) { $ parentType = Strings :: substring ( $ parentType , strlen ( 'Abstract' ) ) ; } return $ parentType ; }
- SomeInterface => Some
- SomeAbstract => Some
- AbstractSome => Some
- SomeInterface = > Some - SomeAbstract = > Some - AbstractSome = > Some