public function newRef($node, $parent, $nodeindex, $nodename) { if (array_key_exists('$ref', $node)) { if (strspn($node['$ref'], '#') != 1) { $error = JsonUtil::uiMessage('jsonschema-badidref', $node['$ref']); throw new JsonSchemaException($error); } $idref = $node['$ref']; try { $node = $this->idtable[$idref]; } catch (Exception $e) { $error = JsonUtil::uiMessage('jsonschema-badidref', $node['$ref']); throw new JsonSchemaException($error); } } return new TreeRef($node, $parent, $nodeindex, $nodename); }