getNamespace() public method

Get the entered namespace.
public getNamespace ( ) : string
return string
 /**
  * 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());
 }
Beispiel #2
0
 /**
  * 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);
 }