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 )
@@ -159,7 +159,7 @@ public function merge(mixed $value, mixed $base): mixed
159159 return $ value ;
160160 }
161161
162- if (is_array ($ value ) && is_array ($ base ) && ( $ this -> itemsValue || $ this -> mergeMode ) ) {
162+ if (is_array ($ value ) && is_array ($ base )) {
163163 $ index = $ this ->mergeMode === MergeMode::OverwriteKeys ? null : 0 ;
164164 foreach ($ value as $ key => $ val ) {
165165 if ($ key === $ index ) {
@@ -175,7 +175,7 @@ public function merge(mixed $value, mixed $base): mixed
175175 return $ base ;
176176 }
177177
178- return Helpers:: merge ( $ value, $ base );
178+ return $ value === null && is_array ( $ base ) ? $ base : $ value ;
179179 }
180180
181181
You can’t perform that action at this time.
0 commit comments