Skip to content

Commit 5a8e78f

Browse files
bnayalivnevearutop
andcommitted
getAdditionalPropertyNames cause a warning if null (#75)
* bugfix - getAdditionalPropertyNames warning if null * return empty array and improve performance Co-Authored-By: Viacheslav Poturaev <[email protected]>
1 parent 29125e5 commit 5a8e78f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Structure/ObjectItemTrait.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ public function addAdditionalPropertyName($name)
5151
*/
5252
public function getAdditionalPropertyNames()
5353
{
54+
if (null === $this->__additionalPropertyNames) {
55+
return [];
56+
}
5457
return array_keys($this->__additionalPropertyNames);
5558
}
5659

@@ -155,4 +158,4 @@ protected function getFromRefPath() {
155158
}
156159
return $this->__refPath;
157160
}
158-
}
161+
}

0 commit comments

Comments
 (0)