original_string: public function removeClass($class)
      {
          if (isset($this->attr['class'])) {
              $classes = explode(' ', $this->attr['class']);
              if (in_array($class, $classes)) {
                  $classes = array_diff($classes, [$class]);
              }
  
              if (empty($classes)) {
                  unset($this->attr['class']);
              } else {
                  $this->attr['class'] = implode(' ', $classes);
              }
          }
      }
code: public function removeClass($class)
      {
          if (isset($this->attr['class'])) {
              $classes = explode(' ', $this->attr['class']);
              if (in_array($class, $classes)) {
                  $classes = array_diff($classes, [$class]);
              }
  
              if (empty($classes)) {
                  unset($this->attr['class']);
              } else {
                  $this->attr['class'] = implode(' ', $classes);
              }
          }
      }
code_tokens: public function removeClass ( $ class ) { if ( isset ( $ this -> attr [ 'class' ] ) ) { $ classes = explode ( ' ' , $ this -> attr [ 'class' ] ) ; if ( in_array ( $ class , $ classes ) ) { $ classes = array_diff ( $ classes , [ $ class ] ) ; } if ( empty ( $ classes ) ) { unset ( $ this -> attr [ 'class' ] ) ; } else { $ this -> attr [ 'class' ] = implode ( ' ' , $ classes ) ; } } }
docstring: Remove class from the "class" attribute.
  
  @param string $class Class to remove
docstring_tokens: Remove class from the class attribute .