Highlight/JsonRef.php
private function resolvePathReferences(&$s, $limit = 20, $depth = 1)
    {
        if ($depth >= $limit) {
            return;
        }

        ++$depth;

        if (is_array($s) || is_object($s)) {
            foreach ($s as $k => &$v) {
                if ($k === "\$ref") {
                    $s = $this->paths[$v];
                } else {
                    $this->resolvePathReferences($v, $limit, $depth);
                }
            }
        }
    }
private function resolvePathReferences(&$s, $limit = 20, $depth = 1)
    {
        if ($depth >= $limit) {
            return;
        }

        ++$depth;

        if (is_array($s) || is_object($s)) {
            foreach ($s as $k => &$v) {
                if ($k === "\$ref") {
                    $s = $this->paths[$v];
                } else {
                    $this->resolvePathReferences($v, $limit, $depth);
                }
            }
        }
    }
private function resolvePathReferences ( & $ s , $ limit = 20 , $ depth = 1 ) { if ( $ depth >= $ limit ) { return ; } ++ $ depth ; if ( is_array ( $ s ) || is_object ( $ s ) ) { foreach ( $ s as $ k => & $ v ) { if ( $ k === "\$ref" ) { $ s = $ this -> paths [ $ v ] ; } else { $ this -> resolvePathReferences ( $ v , $ limit , $ depth ) ; } } } }
Recurse through the data tree and resolve all path references.

@param mixed $s Decoded JSON data (decoded with json_decode)
Recurse through the data tree and resolve all path references .