Skip to content

Commit

Permalink
getAdditionalPropertyNames cause a warning if null (#75)
Browse files Browse the repository at this point in the history
* bugfix - getAdditionalPropertyNames warning if null

* return empty array and improve performance

Co-Authored-By: Viacheslav Poturaev <vearutop@users.noreply.github.com>
  • Loading branch information
bnayalivne and vearutop committed May 16, 2019
1 parent 29125e5 commit 5a8e78f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Structure/ObjectItemTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public function addAdditionalPropertyName($name)
*/
public function getAdditionalPropertyNames()
{
if (null === $this->__additionalPropertyNames) {
return [];
}
return array_keys($this->__additionalPropertyNames);
}

Expand Down Expand Up @@ -155,4 +158,4 @@ protected function getFromRefPath() {
}
return $this->__refPath;
}
}
}

0 comments on commit 5a8e78f

Please sign in to comment.