File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -86,22 +86,22 @@ public function __construct(array $data)
86
86
} else {
87
87
// array
88
88
$ this ->_properties [$ property ] = [];
89
- foreach ($ data [$ property ] as $ item ) {
89
+ foreach ($ data [$ property ] as $ key => $ item ) {
90
90
if ($ type [0 ] === Type::STRING ) {
91
91
if (!is_string ($ item )) {
92
92
$ this ->_errors [] = "property ' $ property' must be array of strings, but array has " . gettype ($ item ) . " element. " ;
93
93
}
94
- $ this ->_properties [$ property ][] = $ item ;
94
+ $ this ->_properties [$ property ][$ key ] = $ item ;
95
95
} elseif (Type::isScalar ($ type [0 ])) {
96
- $ this ->_properties [$ property ][] = $ item ;
96
+ $ this ->_properties [$ property ][$ key ] = $ item ;
97
97
} elseif ($ type [0 ] === Type::ANY ) {
98
98
if (is_array ($ item ) && isset ($ item ['$ref ' ])) {
99
- $ this ->_properties [$ property ][] = new Reference ($ item , null );
99
+ $ this ->_properties [$ property ][$ key ] = new Reference ($ item , null );
100
100
} else {
101
- $ this ->_properties [$ property ][] = $ item ;
101
+ $ this ->_properties [$ property ][$ key ] = $ item ;
102
102
}
103
103
} else {
104
- $ this ->_properties [$ property ][] = $ this ->instantiate ($ type [0 ], $ item );
104
+ $ this ->_properties [$ property ][$ key ] = $ this ->instantiate ($ type [0 ], $ item );
105
105
}
106
106
}
107
107
}
You can’t perform that action at this time.
0 commit comments