/** * Show warning if the project name contains the string "php" * * @param \Symfony\Component\Console\Output\OutputInterface $output * * @return void */ private function projectNameContainsPhpWarning($output) { $projectName = $this->settings->getProjectName(); if ($this->str->contains($projectName, 'php')) { $containsPhpWarning = 'Warning: If you are about to create a micro-package "' . $projectName . '" should optimally not contain a "php" notation in the project name.'; $output->writeln('<error>' . $containsPhpWarning . '</error>'); } }
/** * Construct a correct project namespace name. * * @param boolean $useDoubleSlashes Whether or not to create the namespace with double slashes \\ * * @return string */ protected function createNamespace($useDoubleSlashes = false) { $namespace = $this->settings->getNamespace(); $projectName = $this->settings->getProjectName(); if ($namespace === 'Vendor\\Project' || $namespace === $projectName) { return $this->str->createNamespace($projectName, true, $useDoubleSlashes); } return $this->str->createNamespace($namespace, false, $useDoubleSlashes); }