File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ All Notable changes to `bakame/http-strucured-fields` will be documented in this
21
21
- ` Parameters::valueByKey `
22
22
- ` Parameters::valueByIndex `
23
23
- Added a validation mechanism to facilitate ` Item ` and ` Parameters ` validation against field definition.
24
+ - ` Dictionary::mergeParametersByPairs ` , ` Dictionary::mergeParametersByAssociative `
25
+ - ` Parameters::mergeParametersByPairs ` , ` Parameters::mergeParametersByAssociative `
24
26
25
27
### Fixed
26
28
Original file line number Diff line number Diff line change @@ -231,4 +231,30 @@ public function filterParameters(callable $callback): static
231
231
{
232
232
return $ this ->withParameters ($ this ->parameters ()->filter ($ callback ));
233
233
}
234
+
235
+ /**
236
+ * Merges multiple instances using iterable pairs.
237
+ *
238
+ * This method MUST retain the state of the current instance, and return
239
+ * an instance that contains the specified changes.
240
+ *
241
+ * @param StructuredFieldProvider|Parameters|Dictionary|iterable<array{0:string, 1:SfItemInput}> ...$others
242
+ */
243
+ public function mergeParametersByPairs (...$ others ): static
244
+ {
245
+ return $ this ->withParameters ($ this ->parameters ()->mergePairs (...$ others ));
246
+ }
247
+
248
+ /**
249
+ * Merges multiple instances using iterable associative.
250
+ *
251
+ * This method MUST retain the state of the current instance, and return
252
+ * an instance that contains the specified changes.
253
+ *
254
+ * @param StructuredFieldProvider|Dictionary|Parameters|iterable<string, SfItemInput> ...$others
255
+ */
256
+ public function mergeParametersByAssociative (...$ others ): static
257
+ {
258
+ return $ this ->withParameters ($ this ->parameters ()->mergeAssociative (...$ others ));
259
+ }
234
260
}
You can’t perform that action at this time.
0 commit comments