File tree 2 files changed +5
-24
lines changed
2 files changed +5
-24
lines changed Original file line number Diff line number Diff line change @@ -24,18 +24,6 @@ parameters:
24
24
count : 1
25
25
path : src/Analysers/ReflectionAnalyser.php
26
26
27
- -
28
- message : ' #^Access to an undefined property OpenApi\\Annotations\\AbstractAnnotation\:\:\$description\.$#'
29
- identifier : property.notFound
30
- count : 1
31
- path : src/Annotations/AbstractAnnotation.php
32
-
33
- -
34
- message : ' #^Access to an undefined property OpenApi\\Annotations\\AbstractAnnotation\:\:\$summary\.$#'
35
- identifier : property.notFound
36
- count : 1
37
- path : src/Annotations/AbstractAnnotation.php
38
-
39
27
-
40
28
message : ' #^Call to function property_exists\(\) with OpenApi\\Annotations\\AbstractAnnotation and ' ' _context' ' will always evaluate to true\.$#'
41
29
identifier : function.alreadyNarrowedType
Original file line number Diff line number Diff line change @@ -354,10 +354,8 @@ public function jsonSerialize()
354
354
$ ref = ['$ref ' => $ data ->ref ];
355
355
if ($ this ->_context ->isVersion (OpenApi::VERSION_3_1_0 )) {
356
356
foreach (['summary ' , 'description ' ] as $ prop ) {
357
- if (property_exists ($ this , $ prop )) {
358
- if (!Generator::isDefault ($ this ->{$ prop })) {
359
- $ ref [$ prop ] = $ data ->{$ prop };
360
- }
357
+ if (property_exists ($ data , $ prop )) {
358
+ $ ref [$ prop ] = $ data ->{$ prop };
361
359
}
362
360
}
363
361
}
@@ -368,16 +366,11 @@ public function jsonSerialize()
368
366
} else {
369
367
$ ref ['nullable ' ] = $ data ->nullable ;
370
368
}
371
- unset($ data ->nullable );
369
+ unset($ data ->ref , $ data -> nullable );
372
370
373
371
// preserve other properties
374
- foreach (get_object_vars ($ this ) as $ property => $ value ) {
375
- if ('_ ' === $ property [0 ] || in_array ($ property , ['ref ' , 'nullable ' ])) {
376
- continue ;
377
- }
378
- if (!Generator::isDefault ($ value )) {
379
- $ ref [$ property ] = $ value ;
380
- }
372
+ foreach (get_object_vars ($ data ) as $ property => $ value ) {
373
+ $ ref [$ property ] = $ value ;
381
374
}
382
375
}
383
376
$ data = (object ) $ ref ;
You can’t perform that action at this time.
0 commit comments