src/CodeGeneration/NamespaceHelper.php
public function cropSuffix(string $fqn, string $suffix): string
    {
        if ($suffix === \substr($fqn, -\strlen($suffix))) {
            return \substr($fqn, 0, -\strlen($suffix));
        }

        return $fqn;
    }
public function cropSuffix(string $fqn, string $suffix): string
    {
        if ($suffix === \substr($fqn, -\strlen($suffix))) {
            return \substr($fqn, 0, -\strlen($suffix));
        }

        return $fqn;
    }
public function cropSuffix ( string $ fqn , string $ suffix ) : string { if ( $ suffix === \ substr ( $ fqn , - \ strlen ( $ suffix ) ) ) { return \ substr ( $ fqn , 0 , - \ strlen ( $ suffix ) ) ; } return $ fqn ; }
Crop a suffix from an FQN if it is there.

If it is not there, do nothing and return the FQN as is

@param string $fqn
@param string $suffix

@return string
Crop a suffix from an FQN if it is there .