original_string: private static function add_class($class = '', array $attributes = null) {
          if ($class !== '') {
              $classattribute = array('class' => $class);
              if ($attributes) {
                  if (array_key_exists('class', $attributes)) {
                      $attributes['class'] = trim($attributes['class'] . ' ' . $class);
                  } else {
                      $attributes = $classattribute + $attributes;
                  }
              } else {
                  $attributes = $classattribute;
              }
          }
          return $attributes;
      }
code: private static function add_class($class = '', array $attributes = null) {
          if ($class !== '') {
              $classattribute = array('class' => $class);
              if ($attributes) {
                  if (array_key_exists('class', $attributes)) {
                      $attributes['class'] = trim($attributes['class'] . ' ' . $class);
                  } else {
                      $attributes = $classattribute + $attributes;
                  }
              } else {
                  $attributes = $classattribute;
              }
          }
          return $attributes;
      }
code_tokens: private static function add_class ( $ class = '' , array $ attributes = null ) { if ( $ class !== '' ) { $ classattribute = array ( 'class' => $ class ) ; if ( $ attributes ) { if ( array_key_exists ( 'class' , $ attributes ) ) { $ attributes [ 'class' ] = trim ( $ attributes [ 'class' ] . ' ' . $ class ) ; } else { $ attributes = $ classattribute + $ attributes ; } } else { $ attributes = $ classattribute ; } } return $ attributes ; }
docstring: Combines a class parameter with other attributes. Aids in code reduction
  because the class parameter is very frequently used.
  
  If the class attribute is specified both in the attributes and in the
  class parameter, the two values are combined with a space between.
  
  @param string $class Optional CSS class (or classes as space-separated list)
  @param array $attributes Optional other attributes as array
  @return array Attributes (or null if still none)
docstring_tokens: Combines a class parameter with other attributes . Aids in code reduction because the class parameter is very frequently used .