Readability\Readability::getWeight PHP Method

getWeight() public method

Get an element relative weight.
public getWeight ( DOMElement $e ) : integer
$e DOMElement
return integer
    public function getWeight($e)
    {
        if (!$this->flagIsActive(self::FLAG_WEIGHT_ATTRIBUTES)) {
            return 0;
        }
        $weight = 0;
        // Look for a special classname
        $weight += $this->weightAttribute($e, 'class');
        // Look for a special ID
        $weight += $this->weightAttribute($e, 'id');
        return $weight;
    }