original_string: public function getTheme($themeName)
      {
          if (empty($themeName)) {
              throw new \InvalidArgumentException('The theme name must not be empty.');
          } elseif (!$this->hasTheme($themeName)) {
              throw new \LogicException(sprintf('Unable to retrieve definition for theme "%s".', $themeName));
          }
  
          if (!isset($this->instances[$themeName])) {
              $theme = $this->themeFactory->create($themeName, $this->themeDefinitions[$themeName]);
              $this->instances[$themeName] = $this->mergePageTemplates($theme);
          }
  
          return $this->instances[$themeName];
      }
code: public function getTheme($themeName)
      {
          if (empty($themeName)) {
              throw new \InvalidArgumentException('The theme name must not be empty.');
          } elseif (!$this->hasTheme($themeName)) {
              throw new \LogicException(sprintf('Unable to retrieve definition for theme "%s".', $themeName));
          }
  
          if (!isset($this->instances[$themeName])) {
              $theme = $this->themeFactory->create($themeName, $this->themeDefinitions[$themeName]);
              $this->instances[$themeName] = $this->mergePageTemplates($theme);
          }
  
          return $this->instances[$themeName];
      }
code_tokens: public function getTheme ( $ themeName ) { if ( empty ( $ themeName ) ) { throw new \ InvalidArgumentException ( 'The theme name must not be empty.' ) ; } elseif ( ! $ this -> hasTheme ( $ themeName ) ) { throw new \ LogicException ( sprintf ( 'Unable to retrieve definition for theme "%s".' , $ themeName ) ) ; } if ( ! isset ( $ this -> instances [ $ themeName ] ) ) { $ theme = $ this -> themeFactory -> create ( $ themeName , $ this -> themeDefinitions [ $ themeName ] ) ; $ this -> instances [ $ themeName ] = $ this -> mergePageTemplates ( $ theme ) ; } return $ this -> instances [ $ themeName ] ; }
docstring: Gets theme model instance
  
  @param string $themeName
  
  @return Theme
docstring_tokens: Gets theme model instance