src/main/php/creator/FileCreator.php
private function fileNameForPsr4(array $psr4Pathes, string $className, string $type): string
    {
        foreach ($psr4Pathes as $prefix => $path) {
            if (substr($className, 0, strlen($prefix)) === $prefix) {
                return $this->rootpath->to(
                        str_replace('main', $type, $path),
                        str_replace(
                                '\\',
                                DIRECTORY_SEPARATOR,
                                str_replace($prefix, '', $className)
                        ) . '.php'
                );
            }
        }

        throw new \UnexpectedValueException(
                'No PSR-4 path for class ' . $className . ' found in composer.json'
        );
    }
private function fileNameForPsr4(array $psr4Pathes, string $className, string $type): string
    {
        foreach ($psr4Pathes as $prefix => $path) {
            if (substr($className, 0, strlen($prefix)) === $prefix) {
                return $this->rootpath->to(
                        str_replace('main', $type, $path),
                        str_replace(
                                '\\',
                                DIRECTORY_SEPARATOR,
                                str_replace($prefix, '', $className)
                        ) . '.php'
                );
            }
        }

        throw new \UnexpectedValueException(
                'No PSR-4 path for class ' . $className . ' found in composer.json'
        );
    }
private function fileNameForPsr4 ( array $ psr4Pathes , string $ className , string $ type ) : string { foreach ( $ psr4Pathes as $ prefix => $ path ) { if ( substr ( $ className , 0 , strlen ( $ prefix ) ) === $ prefix ) { return $ this -> rootpath -> to ( str_replace ( 'main' , $ type , $ path ) , str_replace ( '\\' , DIRECTORY_SEPARATOR , str_replace ( $ prefix , '' , $ className ) ) . '.php' ) ; } } throw new \ UnexpectedValueException ( 'No PSR-4 path for class ' . $ className . ' found in composer.json' ) ; }
retrieve psr-4 compatible file name

@param   array   $psr4Pathes  map of psr-4 pathes from composer.json
@param   string  $className   name of class to retrieve file name for
@param   string  $type        whether it a normal class or a test class
@return  string
@throws  \UnexpectedValueException
retrieve psr - 4 compatible file name