/** * Shows warnings and sets a new settings which overwrites * invalid settings with default values. * * @param \Symfony\Component\Console\Output\OutputInterface $output * @return void */ private function warnAndOverwriteInvalidSettingsWithDefaults($output) { $this->projectNameContainsPhpWarning($output); $license = $this->supportedLicenseWarning($output); $testFramework = $this->testFrameworkWarning($output); $phpVersion = $this->phpVersionWarning($output); $this->settings = new Settings($this->settings->getProjectName(), $testFramework, $license, $this->settings->getNamespace(), $this->settings->withGitInit(), $this->settings->withPhpcsConfiguration(), $this->settings->getComposerKeywords(), $this->settings->withVagrantfile(), $this->settings->withEditorConfig(), $phpVersion, $this->settings->withEnvironmentFiles(), $this->settings->withLgtmConfiguration(), $this->settings->withGithubTemplates(), $this->settings->withCodeOfConduct(), $this->settings->withGithubDocs()); }
/** * Generate CONTRIBUTING.md file. * * @return void */ protected function contributing() { if ($this->settings->withPhpcsConfiguration()) { $contributing = $this->file->get(__DIR__ . '/stubs/CONTRIBUTING.PHPCS.stub'); } else { $contributing = $this->file->get(__DIR__ . '/stubs/CONTRIBUTING.stub'); } $placeholder = ['{project_lower}', '{git_message_path}']; $replacements = [$this->projectLower, '.gitmessage']; if ($this->settings->withGithubTemplates()) { $replacements = [$this->projectLower, '../.gitmessage']; } $content = str_replace($placeholder, $replacements, $contributing); $this->file->put($this->projectLower . '/' . 'CONTRIBUTING.md', $content); $this->exportIgnores[] = 'CONTRIBUTING.md'; }