lib/PHPPdf/Core/Node/Node.php
public function setAttribute($name, $value)
    {
        $this->throwExceptionIfAttributeDosntExist($name);
        
        $class = get_class($this);
        if(isset(self::$attributeSetters[$class][$name]))
        {
            $methodName = self::$attributeSetters[$class][$name];
            $this->$methodName($value);
        }
        else
        {
            $this->setAttributeDirectly($name, $value);
        }

        return $this;
    }
public function setAttribute($name, $value)
    {
        $this->throwExceptionIfAttributeDosntExist($name);
        
        $class = get_class($this);
        if(isset(self::$attributeSetters[$class][$name]))
        {
            $methodName = self::$attributeSetters[$class][$name];
            $this->$methodName($value);
        }
        else
        {
            $this->setAttributeDirectly($name, $value);
        }

        return $this;
    }
public function setAttribute ( $ name , $ value ) { $ this -> throwExceptionIfAttributeDosntExist ( $ name ) ; $ class = get_class ( $ this ) ; if ( isset ( self :: $ attributeSetters [ $ class ] [ $ name ] ) ) { $ methodName = self :: $ attributeSetters [ $ class ] [ $ name ] ; $ this -> $ methodName ( $ value ) ; } else { $ this -> setAttributeDirectly ( $ name , $ value ) ; } return $ this ; }
Sets attribute value

@param string $name Name of attribute
@param mixed $value Value of attribute

@throws InvalidAttributeException If attribute isn't supported by this node
@return Node Self reference
Sets attribute value