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'
        );
    }