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
The Token data type is a special string as defined in the RFC. To distinguish it from a normal string, the `Bakame\Http\StructuredFields\Token` class is used.
121
+
The Token data type is a special string as defined in the RFC. To distinguish it from a normal string,
122
+
the `Bakame\Http\StructuredFields\Token` class is used.
129
123
130
124
To instantiate the class you are required to use the `Token::fromString` named constructor.
131
125
The class also exposes the complementary public methods `Token::toString` as well as the `Token::toHttpValue` to enable its textual representation.
Instantiation via type recognition is done using the `Item::from` named constructor.
167
166
168
167
- The first argument represents one of the six (6) item type value;
169
-
- The second argument, which is optional, MUST be an iterable construct where its index represents the parameter key and its value an item or a item type value;
168
+
- The second argument, which is optional, MUST be an iterable construct
169
+
where its index represents the parameter key and its value an item or an item type value;
Conversely, the `Item::fromPair` is an alternative to the `Item::from`
188
-
which expects a tuple composed by an array as a list where:
187
+
`Item::fromPair` is an alternative to the `Item::from` named constructor, it expects
188
+
a tuple composed by an array as a list where:
189
189
190
190
- The first member on index `0` represents one of the six (6) item type value;
191
-
- The second optional member, on index `1`, MUST be an iterable construct containing tuples of key-value pairs;
191
+
- The second optional member, on index `1`, **MUST** be an iterable construct containing
192
+
tuples of key-value pairs;
192
193
193
194
Once instantiated, accessing `Item` properties is done via two (2) readonly properties:
194
195
@@ -238,8 +239,7 @@ At any given time it is possible with each of these objects to:
238
239
**Of note:**
239
240
240
241
- All setter methods are chainable
241
-
- For setter methods, Item types are inferred using `Item::from` if a `Item` object is not submitted.
242
-
- Because all containers can be access by their indexes, some changes may re-index them as to not expose missing indexes.
242
+
- For setter methods, Item types are inferred using `Item::from` if a `Item` object is not provided.
243
243
244
244
#### Ordered Maps
245
245
@@ -271,7 +271,7 @@ key to its members
271
271
-`Parameters` can only contain `Item` instances
272
272
-`Dictionary` instance can contain `Item` and/or `InnerList` instances.
273
273
274
-
Both classes exposes the following:
274
+
Both classes expose the following:
275
275
276
276
named constructors:
277
277
@@ -283,9 +283,9 @@ getter methods:
283
283
-`toPairs` returns an iterator to iterate over the container pairs;
284
284
-`keys` to list all existing keys of the ordered maps as an array list;
285
285
-`has` tell whether a specific element is associated to a given `key`;
286
-
-`hasPair` tell whether a `key-value` association exists at a given `index` (negative indexes are supported);
286
+
-`hasPair` tell whether a `key-value` association exists at a given `index`;
287
287
-`get` returns the element associated to a specific `key`;
288
-
-`pair` returns the key-pair association present at a specific `index` (negative indexes are supported);
288
+
-`pair` returns the key-pair association present at a specific `index`;
289
289
290
290
setter methods:
291
291
@@ -298,9 +298,9 @@ setter methods:
298
298
299
299
The `Parameters` instance exposes the following additional methods:
300
300
301
-
-`Parameters::values()` to list all existing Bare Items value as an array list;
302
-
-`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;
303
-
-`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.
301
+
-`Parameters::values` to list all existing Bare Items value as an array list;
302
+
-`Parameters::value` to return the value of the Bare Item associated to the `$key` or `null` if the key is unknown or invalid;
303
+
-`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