original_string: public function addAttribute($element_name, $attr_name, $def)
      {
          $module = $this->getAnonymousModule();
          if (!isset($module->info[$element_name])) {
              $element = $module->addBlankElement($element_name);
          } else {
              $element = $module->info[$element_name];
          }
          $element->attr[$attr_name] = $def;
      }
code: public function addAttribute($element_name, $attr_name, $def)
      {
          $module = $this->getAnonymousModule();
          if (!isset($module->info[$element_name])) {
              $element = $module->addBlankElement($element_name);
          } else {
              $element = $module->info[$element_name];
          }
          $element->attr[$attr_name] = $def;
      }
code_tokens: public function addAttribute ( $ element_name , $ attr_name , $ def ) { $ module = $ this -> getAnonymousModule ( ) ; if ( ! isset ( $ module -> info [ $ element_name ] ) ) { $ element = $ module -> addBlankElement ( $ element_name ) ; } else { $ element = $ module -> info [ $ element_name ] ; } $ element -> attr [ $ attr_name ] = $ def ; }
docstring: Adds a custom attribute to a pre-existing element
  @note This is strictly convenience, and does not have a corresponding
  method in HTMLPurifier_HTMLModule
  @param string $element_name Element name to add attribute to
  @param string $attr_name Name of attribute
  @param mixed $def Attribute definition, can be string or object, see
  HTMLPurifier_AttrTypes for details
docstring_tokens: Adds a custom attribute to a pre - existing element