src/main/php/creator/FileCreator.php
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))
                )
        );
    }
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))
                )
        );
    }
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 ) ) ) ) ; }
creates file of given type for given class

@param  string  $fileName
@param  string  $className
@param  string  $template
creates file of given type for given class