FluentDOM\Serializer\Json\BadgerFish::addAttributes PHP Method

addAttributes() protected method

protected addAttributes ( stdClass $target, DOMElement $node, Xpath $xpath )
$target stdClass
$node DOMElement
$xpath FluentDOM\Xpath
    protected function addAttributes(\stdClass $target, \DOMElement $node, Xpath $xpath)
    {
        foreach ($xpath->evaluate('@*', $node) as $attribute) {
            $target->{'@' . $attribute->name} = $attribute->value;
        }
    }