Exemple #1
0
 private function resolveReferences()
 {
     if ($this->references) {
         foreach (array_keys($this->references) as $ref) {
             $keys = JsonUtils::pathDecode($ref);
             if ($schema = $this->find($this->data, $keys)) {
                 $this->references[$ref] = $schema;
             } else {
                 throw new \RuntimeException('Unable to find ref ' . $ref);
             }
         }
         foreach ($this->references as $ref => $schema) {
             $this->references[$ref] = $this->resolve($schema);
         }
         $this->data = JsonUtils::dataCopy($this->data, array($this, 'resolveCallback'));
         $this->references = array();
     }
 }