original_string: protected function createSite($path, $themeName, $preferLock, $preferSource, $noScripts)
      {
          $this->checkRequirements($themeName);
  
          $themePair = new PackageNameVersion($themeName);
          $this->createBlankSite($path, $themePair);
  
          if ($themeName === self::BLANK_THEME) {
              return;
          }
  
          if ($this->packageManager->existPackage($themeName) === false) {
              throw new \RuntimeException(sprintf('The theme: "%s" does not exist at registered repositories.', $themeName));
          }
  
          if ($this->packageManager->isThemePackage($themeName) === false) {
              throw new \RuntimeException(sprintf('The theme: "%s" is not a Spress theme.', $themeName));
          }
  
          if ($this->packageManager->isPackageDependOn($themeName, $this->spressInstallerPackage) === false) {
              throw new \RuntimeException(sprintf(
                  sprintf('This version of Spress requires a theme with "%s".', $this->spressInstallerPackage),
                  $themeName
              ));
          }
  
          $this->updateDependencies($preferLock, $preferSource, $noScripts);
  
          $relativeThemePath = 'src/themes/'.$themePair->getName();
          $this->copyContentFromThemeToSite($path, $relativeThemePath);
          $this->setUpSiteConfigFile($path, $relativeThemePath, $themePair->getName());
      }
code: protected function createSite($path, $themeName, $preferLock, $preferSource, $noScripts)
      {
          $this->checkRequirements($themeName);
  
          $themePair = new PackageNameVersion($themeName);
          $this->createBlankSite($path, $themePair);
  
          if ($themeName === self::BLANK_THEME) {
              return;
          }
  
          if ($this->packageManager->existPackage($themeName) === false) {
              throw new \RuntimeException(sprintf('The theme: "%s" does not exist at registered repositories.', $themeName));
          }
  
          if ($this->packageManager->isThemePackage($themeName) === false) {
              throw new \RuntimeException(sprintf('The theme: "%s" is not a Spress theme.', $themeName));
          }
  
          if ($this->packageManager->isPackageDependOn($themeName, $this->spressInstallerPackage) === false) {
              throw new \RuntimeException(sprintf(
                  sprintf('This version of Spress requires a theme with "%s".', $this->spressInstallerPackage),
                  $themeName
              ));
          }
  
          $this->updateDependencies($preferLock, $preferSource, $noScripts);
  
          $relativeThemePath = 'src/themes/'.$themePair->getName();
          $this->copyContentFromThemeToSite($path, $relativeThemePath);
          $this->setUpSiteConfigFile($path, $relativeThemePath, $themePair->getName());
      }
code_tokens: protected function createSite ( $ path , $ themeName , $ preferLock , $ preferSource , $ noScripts ) { $ this -> checkRequirements ( $ themeName ) ; $ themePair = new PackageNameVersion ( $ themeName ) ; $ this -> createBlankSite ( $ path , $ themePair ) ; if ( $ themeName === self :: BLANK_THEME ) { return ; } if ( $ this -> packageManager -> existPackage ( $ themeName ) === false ) { throw new \ RuntimeException ( sprintf ( 'The theme: "%s" does not exist at registered repositories.' , $ themeName ) ) ; } if ( $ this -> packageManager -> isThemePackage ( $ themeName ) === false ) { throw new \ RuntimeException ( sprintf ( 'The theme: "%s" is not a Spress theme.' , $ themeName ) ) ; } if ( $ this -> packageManager -> isPackageDependOn ( $ themeName , $ this -> spressInstallerPackage ) === false ) { throw new \ RuntimeException ( sprintf ( sprintf ( 'This version of Spress requires a theme with "%s".' , $ this -> spressInstallerPackage ) , $ themeName ) ) ; } $ this -> updateDependencies ( $ preferLock , $ preferSource , $ noScripts ) ; $ relativeThemePath = 'src/themes/' . $ themePair -> getName ( ) ; $ this -> copyContentFromThemeToSite ( $ path , $ relativeThemePath ) ; $ this -> setUpSiteConfigFile ( $ path , $ relativeThemePath , $ themePair -> getName ( ) ) ; }
docstring: Create a site.
  
  @param string $path      Where the site will be located
  @param string $themeName The name of the theme the site based on
  
  @throws LogicException           If the packageManager is null
  @throws RuntimeException         If an error occurs while installing the theme
  @throws InvalidArgumentException If the theme's name is invalid
docstring_tokens: Create a site .