Skip to content

Commit a1fb916

Browse files
committed
fix type error if reference data is an array
1 parent 53dd1f4 commit a1fb916

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/spec/Reference.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public function resolve(ReferenceContext $context = null)
221221
$referencedObject = $this->_to !== null ? new $this->_to($referencedData) : $referencedData;
222222

223223
if ($jsonReference->getJsonPointer()->getPointer() === '') {
224-
$newContext = new ReferenceContext($referencedObject, $file);
224+
$newContext = new ReferenceContext($referencedObject instanceof SpecObjectInterface ? $referencedObject : null, $file);
225225
if ($referencedObject instanceof DocumentContextInterface) {
226226
$referencedObject->setDocumentContext($referencedObject, $jsonReference->getJsonPointer());
227227
}

0 commit comments

Comments
 (0)