src/CodeGeneration/Generator/Embeddable/ArchetypeEmbeddableGenerator.php
private function getNewPathFromArchetypePath(string $archetypePath): string
    {
        $rootArchetypePath = substr($archetypePath, 0, \ts\strpos($archetypePath, '/src/Entity/Embeddable'));

        $path = \str_replace($rootArchetypePath, $this->pathToProjectRoot, $archetypePath);

        $pattern     = '%^(.*?)/([^/]*?)' . $this->archetypeObjectClassName . '([^/]*?)php$%m';
        $replacement = '$1/$2' . $this->newObjectClassName . '$3php';

        $path = \preg_replace($pattern, $replacement, $path, -1, $replacements);
        if (0 === $replacements) {
            throw new \RuntimeException('Failed updating the path with regex in ' . __METHOD__);
        }

        return $path;
    }
private function getNewPathFromArchetypePath(string $archetypePath): string
    {
        $rootArchetypePath = substr($archetypePath, 0, \ts\strpos($archetypePath, '/src/Entity/Embeddable'));

        $path = \str_replace($rootArchetypePath, $this->pathToProjectRoot, $archetypePath);

        $pattern     = '%^(.*?)/([^/]*?)' . $this->archetypeObjectClassName . '([^/]*?)php$%m';
        $replacement = '$1/$2' . $this->newObjectClassName . '$3php';

        $path = \preg_replace($pattern, $replacement, $path, -1, $replacements);
        if (0 === $replacements) {
            throw new \RuntimeException('Failed updating the path with regex in ' . __METHOD__);
        }

        return $path;
    }
private function getNewPathFromArchetypePath ( string $ archetypePath ) : string { $ rootArchetypePath = substr ( $ archetypePath , 0 , \ ts \ strpos ( $ archetypePath , '/src/Entity/Embeddable' ) ) ; $ path = \ str_replace ( $ rootArchetypePath , $ this -> pathToProjectRoot , $ archetypePath ) ; $ pattern = '%^(.*?)/([^/]*?)' . $ this -> archetypeObjectClassName . '([^/]*?)php$%m' ; $ replacement = '$1/$2' . $ this -> newObjectClassName . '$3php' ; $ path = \ preg_replace ( $ pattern , $ replacement , $ path , - 1 , $ replacements ) ; if ( 0 === $ replacements ) { throw new \ RuntimeException ( 'Failed updating the path with regex in ' . __METHOD__ ) ; } return $ path ; }
Calculate the new path by doing a preg replace on the corresponding archetype path

@param string $archetypePath

@return null|string|string[]
Calculate the new path by doing a preg replace on the corresponding archetype path