original_string: public function addTemplatePath($path)
      {
          if (is_array($this->templatesPath)) {
              if (array_search($path, $this->templatesPath)) {
                  throw new \LogicException(sprintf('Templates path "%s" exists.', $path));
              } else {
                  $this->templatesPath[] = $path;
              }
          } else if (is_string($this->templatesPath)) {
              $lastTemplate = $this->templatesPath;
              $this->templatesPath = array(
                  $lastTemplate, $path
              );
          }
      }
code: public function addTemplatePath($path)
      {
          if (is_array($this->templatesPath)) {
              if (array_search($path, $this->templatesPath)) {
                  throw new \LogicException(sprintf('Templates path "%s" exists.', $path));
              } else {
                  $this->templatesPath[] = $path;
              }
          } else if (is_string($this->templatesPath)) {
              $lastTemplate = $this->templatesPath;
              $this->templatesPath = array(
                  $lastTemplate, $path
              );
          }
      }
code_tokens: public function addTemplatePath ( $ path ) { if ( is_array ( $ this -> templatesPath ) ) { if ( array_search ( $ path , $ this -> templatesPath ) ) { throw new \ LogicException ( sprintf ( 'Templates path "%s" exists.' , $ path ) ) ; } else { $ this -> templatesPath [ ] = $ path ; } } else if ( is_string ( $ this -> templatesPath ) ) { $ lastTemplate = $ this -> templatesPath ; $ this -> templatesPath = array ( $ lastTemplate , $ path ) ; } }
docstring: Add Template Path
  
  @param string $path Templates path
docstring_tokens: Add Template Path