original_string: public function addClass($className)
      {
          if(strlen($className) < 1)
          {
              throw new HTMLTagException("Class name is empty");
          }
  
          if(!$this->hasClass($className))
          {
              $classes = $this->getClasses() . " " . $this->removeMultipleSpaces(trim($className));
              $this->setAttribute("class",trim($classes));
          }
  
          return $this;
      }
code: public function addClass($className)
      {
          if(strlen($className) < 1)
          {
              throw new HTMLTagException("Class name is empty");
          }
  
          if(!$this->hasClass($className))
          {
              $classes = $this->getClasses() . " " . $this->removeMultipleSpaces(trim($className));
              $this->setAttribute("class",trim($classes));
          }
  
          return $this;
      }
code_tokens: public function addClass ( $ className ) { if ( strlen ( $ className ) < 1 ) { throw new HTMLTagException ( "Class name is empty" ) ; } if ( ! $ this -> hasClass ( $ className ) ) { $ classes = $ this -> getClasses ( ) . " " . $ this -> removeMultipleSpaces ( trim ( $ className ) ) ; $ this -> setAttribute ( "class" , trim ( $ classes ) ) ; } return $ this ; }
docstring: Add a class name to the class attribute, this won't add duplicates.
  @param   string  $className
  @return  HTMLTag
  @throws  HTMLTagException
docstring_tokens: Add a class name to the class attribute this won t add duplicates .