protected function createFile(string $fileName, string $className, string $template)
    {
        $directory = dirname($fileName);
        if (!file_exists($directory . '/.')) {
            mkdir($directory, 0755, true);
        }

        file_put_contents(
                $fileName,
                str_replace(
                        ['{NAMESPACE}', '{CLASS}'],
                        [$this->namespaceOf($className),
                         $this->nonQualifiedClassNameOf($className)
                        ],
                        $this->resourceLoader->load($this->pathForTemplate($template))
                )
        );
    }