public function resolveNamespace(string $path, bool $asPackage = false): string
    {
        $file       = new File($path);
        $pathInfo   = array_filter(explode(DIRECTORY_SEPARATOR, trim(str_replace([$this->configRepository->getRootPath(), 'src'], '', $file->getRealPath()), DIRECTORY_SEPARATOR)));
        $prefix     = 'antares';
        $namespaces = [];

        foreach ($pathInfo as $name) {
            if ($name === 'core') {
                $namespaces[] = $asPackage ? 'foundation' : $name;
                break;
            }
            if ($name === 'app') {
                $namespaces[] = 'foundation';
                break;
            }
            if ($name === 'src') {
                break;
            }
            if (in_array($name, ['components', 'modules'], true)) {
                continue;
            }
            $namespaces[] = $name;
        }

        return $prefix . '/' . implode('/', $namespaces);
    }