module->getLocalPath(), '/'); $files = array_map(static function (string $path) use ($basePath): string { return sprintf('%s/%s', $basePath, $path); }, $paths); $this->getFileSystem()->remove($files); return true; } private function removeClasses(array $classes): bool { $paths = array_map(static function (string $class): string { $class = str_replace(self::$namespacePrefix, '', $class); return 'src/' . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php'; }, $classes); return $this->removeFiles($paths); } private function getFileSystem(): Filesystem { return $this->filesystem ?? $this->filesystem = new Filesystem(); } }