public function generate(string $outputDir) : array
    {
        $generatedFiles = [];

        foreach ($this->generators as $generator) {

            $this->logger->info('Running generator ' . get_class($generator));
            $result = $generator->generate();

            foreach ($result->all() as $phpFile) {

                $path = str_replace(
                    ['/', "\\"],
                    DIRECTORY_SEPARATOR,
                    $outputDir . '/' . $phpFile->getFqcn()->getNamespace()
                );

                BaseUtil::ensureDirectory($path, 0711);

                $filePath = $path . DIRECTORY_SEPARATOR . $phpFile->getFqcn()->getName() . '.php';
                $this->logger->info('Writing to file ' . $filePath);

                file_put_contents($filePath, $phpFile->getText());

                $generatedFiles[] = new GeneratedFile($filePath, $phpFile);
            }
        }

        return $generatedFiles;
    }