protected function copyTemplateFilesToProject(array $filenames, $overwrite = false)
    {
        try {
            $filesystem = $this->taskFilesystemStack();
            foreach ($filenames as $template_path => $target_path) {
                $target_file = ProjectX::projectRoot() . "/{$target_path}";

                $template_file = $this
                    ->templateManager()
                    ->getTemplateFilePath($template_path);

                $filesystem->copy($template_file, $target_file, $overwrite);
            }
            $filesystem->run();
        } catch (\Exception $e) {
            throw new \Exception(
                sprintf('Failed to copy template file(s) into project!')
            );
        }

        return $this;
    }
protected function copyTemplateFilesToProject(array $filenames, $overwrite = false)
    {
        try {
            $filesystem = $this->taskFilesystemStack();
            foreach ($filenames as $template_path => $target_path) {
                $target_file = ProjectX::projectRoot() . "/{$target_path}";

                $template_file = $this
                    ->templateManager()
                    ->getTemplateFilePath($template_path);

                $filesystem->copy($template_file, $target_file, $overwrite);
            }
            $filesystem->run();
        } catch (\Exception $e) {
            throw new \Exception(
                sprintf('Failed to copy template file(s) into project!')
            );
        }

        return $this;
    }
protected function copyTemplateFilesToProject ( array $ filenames , $ overwrite = false ) { try { $ filesystem = $ this -> taskFilesystemStack ( ) ; foreach ( $ filenames as $ template_path => $ target_path ) { $ target_file = ProjectX :: projectRoot ( ) . "/{$target_path}" ; $ template_file = $ this -> templateManager ( ) -> getTemplateFilePath ( $ template_path ) ; $ filesystem -> copy ( $ template_file , $ target_file , $ overwrite ) ; } $ filesystem -> run ( ) ; } catch ( \ Exception $ e ) { throw new \ Exception ( sprintf ( 'Failed to copy template file(s) into project!' ) ) ; } return $ this ; }
Copy template files to project root.

@param array $filenames
An array of template filenames, keyed by target path.
@param bool $overwrite
A flag to determine if the file should be overwritten if exists.

@return self
@throws \Exception
Copy template files to project root .