Skip to content

Commit

Permalink
Check if variable array key exists before execution method (#2182)
Browse files Browse the repository at this point in the history
* Check if variable array key exists before execution method

* fix formatting

* use array function for check

* attempt to fix style issue

---------

Co-authored-by: Vlado Hudak <vlado@grownapps.io>
  • Loading branch information
Vlado-web and Vlado Hudak committed Jan 6, 2024
1 parent 190289b commit 01b75ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion OpenApiPhp/Util.php
Expand Up @@ -424,7 +424,7 @@ private static function mergeFromArray(OA\AbstractAnnotation $annotation, array
if ('$ref' === $propertyName) {
$propertyName = 'ref';
}
if (!\in_array($propertyName, $done, true)) {
if (array_key_exists($propertyName, $defaults) && !\in_array($propertyName, $done, true)) {
self::mergeProperty($annotation, $propertyName, $value, $defaults[$propertyName], $overwrite);
}
}
Expand Down

0 comments on commit 01b75ce

Please sign in to comment.