public function resolve(stdClass $reference)
    {
        $baseUri = $this->getCurrentUri();
        $uri = new Uri($reference->{'$ref'});

        if (!$uri->isAbsolute()) {
            $uri->resolveAgainst($baseUri);
        }

        $identifier = $uri->getPrimaryResourceIdentifier();

        if (!isset($this->schemas[$identifier])) {
            $schema = $this->fetchSchemaAt($identifier);
            $this->registerSchema($schema, $uri);
        } else {
            $schema = $this->schemas[$identifier];
        }

        $resolved = $this->resolvePointer($schema, $uri);

        if ($resolved === $reference) {
            throw new SelfReferencingPointerException();
        }

        if (!is_object($resolved)) {
            throw new InvalidPointerTargetException([$uri->getRawUri()]);
        }

        return [$uri, $resolved];
    }
public function resolve(stdClass $reference)
    {
        $baseUri = $this->getCurrentUri();
        $uri = new Uri($reference->{'$ref'});

        if (!$uri->isAbsolute()) {
            $uri->resolveAgainst($baseUri);
        }

        $identifier = $uri->getPrimaryResourceIdentifier();

        if (!isset($this->schemas[$identifier])) {
            $schema = $this->fetchSchemaAt($identifier);
            $this->registerSchema($schema, $uri);
        } else {
            $schema = $this->schemas[$identifier];
        }

        $resolved = $this->resolvePointer($schema, $uri);

        if ($resolved === $reference) {
            throw new SelfReferencingPointerException();
        }

        if (!is_object($resolved)) {
            throw new InvalidPointerTargetException([$uri->getRawUri()]);
        }

        return [$uri, $resolved];
    }
public function resolve ( stdClass $ reference ) { $ baseUri = $ this -> getCurrentUri ( ) ; $ uri = new Uri ( $ reference -> { '$ref' } ) ; if ( ! $ uri -> isAbsolute ( ) ) { $ uri -> resolveAgainst ( $ baseUri ) ; } $ identifier = $ uri -> getPrimaryResourceIdentifier ( ) ; if ( ! isset ( $ this -> schemas [ $ identifier ] ) ) { $ schema = $ this -> fetchSchemaAt ( $ identifier ) ; $ this -> registerSchema ( $ schema , $ uri ) ; } else { $ schema = $ this -> schemas [ $ identifier ] ; } $ resolved = $ this -> resolvePointer ( $ schema , $ uri ) ; if ( $ resolved === $ reference ) { throw new SelfReferencingPointerException ( ) ; } if ( ! is_object ( $ resolved ) ) { throw new InvalidPointerTargetException ( [ $ uri -> getRawUri ( ) ] ) ; } return [ $ uri , $ resolved ] ; }
Resolves a schema reference according to the JSON Reference
specification draft. Returns an array containing the resolved
URI and the resolved schema.

@param stdClass $reference

@throws InvalidPointerTargetException
@throws SelfReferencingPointerException

@return array
Resolves a schema reference according to the JSON Reference specification draft . Returns an array containing the resolved URI and the resolved schema .