You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://github.com/sponsors/nyamsprod)
10
10
11
-
The package uses pragmatic value objects to parseand serialize[HTTP Structured Fields][1] in PHP.
11
+
The package uses value objects to parse, serialize and buikd[HTTP Structured Fields][1] in PHP.
12
12
13
13
HTTP Structured fields are intended for use by specifications of new HTTP fields that wish to
14
-
use a common syntax that is more restrictive than traditional HTTP field values or could be
15
-
used to [retrofit current headers](https://www.ietf.org/id/draft-ietf-httpbis-retrofit-00.html) to have them compliant with the new syntax.
14
+
use a common syntax that is more restrictive than traditional HTTP field values or could
15
+
be used to [retrofit current headers][2] to have them compliant with the new syntax.
Conversely, the `Item::fromPair` is an alternative to the `Item::from`
127
+
which expects a tuple composed by an array as w list where:
128
+
129
+
- The first member on index `0` represents one of the six (6) item type value;
130
+
- The second optional member, on index `1`, MUST be an iterable construct where its index represents the parameter key and its value an item or a item type value;
**Item types are inferred using `Item::from` if a `Item` object is not submitted.**
209
235
210
-
**EVERY CHANGE IN THE ORDERED MAP WILL RE-INDEX THE PAIRS AS TO NOT EXPOSE MISSING INDEXES**
211
-
212
236
-`Parameters` can only contains `Item` instances
213
237
-`Dictionary` instance can contain `Item` and `InnerList` instances.
214
238
215
-
The `Parameters` instance exposes the following methods:
239
+
The `Parameters` instance exposes the following additional methods:
216
240
217
-
-`Parameters::values` to list all existing Bare Items value as an array list;
241
+
-`Parameters::values()` to list all existing Bare Items value as an array list;
218
242
-`Parameters::value(string $key)` to return the value of the Bare Item associated to the `$key` or `null` if the key is unknown or invalid;
219
-
-`Parameters::merge` also accepts iterable as associative key-value as part of the variadic signature.
243
+
-`Parameters::sanitize()` to return an instance where all Items present in the container are Bare Items. Any non Bared Item instance will see its parameters getting clear up.
0 commit comments