original_string: public function mergeAttributes($attributes)
      {
          $attributes = self::prepareAttributes($attributes);
          foreach ($this->watchedAttributes as $watchedKey) {
              if (isset($attributes[$watchedKey])) {
                  $this->onAttributeChange($watchedKey, $attributes[$watchedKey]);
                  unset($attributes[$watchedKey]);
              }
          }
          $this->attributes = array_merge($this->attributes, $attributes);
          return $this;
      }
code: public function mergeAttributes($attributes)
      {
          $attributes = self::prepareAttributes($attributes);
          foreach ($this->watchedAttributes as $watchedKey) {
              if (isset($attributes[$watchedKey])) {
                  $this->onAttributeChange($watchedKey, $attributes[$watchedKey]);
                  unset($attributes[$watchedKey]);
              }
          }
          $this->attributes = array_merge($this->attributes, $attributes);
          return $this;
      }
code_tokens: public function mergeAttributes ( $ attributes ) { $ attributes = self :: prepareAttributes ( $ attributes ) ; foreach ( $ this -> watchedAttributes as $ watchedKey ) { if ( isset ( $ attributes [ $ watchedKey ] ) ) { $ this -> onAttributeChange ( $ watchedKey , $ attributes [ $ watchedKey ] ) ; unset ( $ attributes [ $ watchedKey ] ) ; } } $ this -> attributes = array_merge ( $ this -> attributes , $ attributes ) ; return $ this ; }
docstring: Merges the existing attributes with the new ones
  
  @param    mixed   Array of attribute 'name' => 'value' pairs or HTML attribute string
  @return   HTML_Common2
docstring_tokens: Merges the existing attributes with the new ones