File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ final class Type implements Schema
2727 private array $ range = [null , null ];
2828 private ?string $ pattern = null ;
2929 private bool $ merge = false ;
30- private ? MergeMode $ mergeMode = null ;
30+ private MergeMode $ mergeMode = MergeMode::AppendKeys ;
3131
3232
3333 public function __construct (string $ type )
@@ -147,7 +147,7 @@ public function merge(mixed $value, mixed $base): mixed
147147 return $ value ;
148148 }
149149
150- if (is_array ($ value ) && is_array ($ base ) && ( $ this -> itemsValue || $ this -> mergeMode ) ) {
150+ if (is_array ($ value ) && is_array ($ base )) {
151151 $ index = $ this ->mergeMode === MergeMode::OverwriteKeys ? null : 0 ;
152152 foreach ($ value as $ key => $ val ) {
153153 if ($ key === $ index ) {
@@ -163,7 +163,7 @@ public function merge(mixed $value, mixed $base): mixed
163163 return $ base ;
164164 }
165165
166- return Helpers:: merge ( $ value, $ base );
166+ return $ value === null && is_array ( $ base ) ? $ base : $ value ;
167167 }
168168
169169
You can’t perform that action at this time.
0 commit comments