private function expandRefs(&$schema, $base = null)
    {
        if (!is_object($schema)) {
            if (is_array($schema)) {
                foreach ($schema as &$member) {
                    $this->expandRefs($member, $base);
                }
            }

            return;
        }

        if (property_exists($schema, 'id') && is_string($schema->id) && $base != $schema->id) {
            $base = $this->uriResolver->resolve($schema->id, $base);
        }

        if (property_exists($schema, '$ref') && is_string($schema->{'$ref'})) {
            $refPointer = new JsonPointer($this->uriResolver->resolve($schema->{'$ref'}, $base));
            $schema->{'$ref'} = (string) $refPointer;
        }

        foreach ($schema as &$member) {
            $this->expandRefs($member, $base);
        }
    }
private function expandRefs(&$schema, $base = null)
    {
        if (!is_object($schema)) {
            if (is_array($schema)) {
                foreach ($schema as &$member) {
                    $this->expandRefs($member, $base);
                }
            }

            return;
        }

        if (property_exists($schema, 'id') && is_string($schema->id) && $base != $schema->id) {
            $base = $this->uriResolver->resolve($schema->id, $base);
        }

        if (property_exists($schema, '$ref') && is_string($schema->{'$ref'})) {
            $refPointer = new JsonPointer($this->uriResolver->resolve($schema->{'$ref'}, $base));
            $schema->{'$ref'} = (string) $refPointer;
        }

        foreach ($schema as &$member) {
            $this->expandRefs($member, $base);
        }
    }
private function expandRefs ( & $ schema , $ base = null ) { if ( ! is_object ( $ schema ) ) { if ( is_array ( $ schema ) ) { foreach ( $ schema as & $ member ) { $ this -> expandRefs ( $ member , $ base ) ; } } return ; } if ( property_exists ( $ schema , 'id' ) && is_string ( $ schema -> id ) && $ base != $ schema -> id ) { $ base = $ this -> uriResolver -> resolve ( $ schema -> id , $ base ) ; } if ( property_exists ( $ schema , '$ref' ) && is_string ( $ schema -> { '$ref' } ) ) { $ refPointer = new JsonPointer ( $ this -> uriResolver -> resolve ( $ schema -> { '$ref' } , $ base ) ) ; $ schema -> { '$ref' } = ( string ) $ refPointer ; } foreach ( $ schema as & $ member ) { $ this -> expandRefs ( $ member , $ base ) ; } }
Recursively resolve all references against the provided base

@param mixed  $schema
@param string $base
Recursively resolve all references against the provided base