saveProjectFiles()

in lib/generator.js [70:86]


  saveProjectFiles() {
    const composerPath = path.join(this.outputDir, 'composer.json');
    fs.writeFileSync(composerPath, JSON.stringify(this.composer, null, 2));
    const projectFiles = ['.gitignore', '.php_cs.dist', 'autoload.php', 'bootstrap.php'];
    projectFiles.map(file => {
      const source = path.join(__dirname, '..', 'templates', `${file}.tmpl`);
      const target = path.join(this.outputDir, file);

      if(file === 'autoload.php') {
        const content = fs.readFileSync(source, 'utf8');
        fs.writeFileSync(target, content.replace(/\${namespace}/g, this.namespace.replace(/\\/, '\\\\')));
      } else {
        fs.copyFileSync(source, target);
      }
      
    });
  }