FluentDOM\Loader\Json\Rayfish::getAttributes PHP Метод

getAttributes() приватный Метод

private getAttributes ( stdClass $json ) : stdClass[]
$json stdClass
Результат stdClass[]
    private function getAttributes($json)
    {
        $attributes = new \stdClass();
        $namespaces = new \stdClass();
        if (isset($json->{'#children'})) {
            foreach ($json->{'#children'} as $child) {
                $name = isset($child->{'#name'}) ? $child->{'#name'} : '';
                $value = isset($child->{'#text'}) ? $child->{'#text'} : '';
                if ($name === '@xmlns' || substr($name, 0, 7) === '@xmlns:') {
                    $namespaces->{substr($name, 1)} = $value;
                } elseif (substr($name, 0, 1) === '@') {
                    $attributes->{substr($name, 1)} = $value;
                }
            }
        }
        return [$attributes, $namespaces];
    }