original_string: public function setAttribute($name, $value = null)
      {
          $name = strtolower($name);
          if (is_null($value)) {
              $value = $name;
          }
          if (in_array($name, $this->watchedAttributes)) {
              $this->onAttributeChange($name, $value);
          } else {
              $this->attributes[$name] = (string)$value;
          }
          return $this;
      }
code: public function setAttribute($name, $value = null)
      {
          $name = strtolower($name);
          if (is_null($value)) {
              $value = $name;
          }
          if (in_array($name, $this->watchedAttributes)) {
              $this->onAttributeChange($name, $value);
          } else {
              $this->attributes[$name] = (string)$value;
          }
          return $this;
      }
code_tokens: public function setAttribute ( $ name , $ value = null ) { $ name = strtolower ( $ name ) ; if ( is_null ( $ value ) ) { $ value = $ name ; } if ( in_array ( $ name , $ this -> watchedAttributes ) ) { $ this -> onAttributeChange ( $ name , $ value ) ; } else { $ this -> attributes [ $ name ] = ( string ) $ value ; } return $ this ; }
docstring: Sets the value of the attribute
  
  @param    string  Attribute name
  @param    string  Attribute value (will be set to $name if omitted)
  @return   HTML_Common2
docstring_tokens: Sets the value of the attribute