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
@@ -109,12 +110,29 @@ are used to represent non-native types as shown in the table below:
109
110
| Token | class `Token`|`Item::isToken`|
110
111
| Byte Sequence | class `ByteSequence`|`Item::isByteSequence`|
111
112
112
-
#### Items with parameters
113
+
Items can be associated with an ordered maps of key-value pairs also known as parameters, where the
114
+
keys are strings and the value are bare items. Their public API is covered in subsequent paragraphs.
115
+
116
+
**An item without any parameter associated to it is said to be a bare item.**
117
+
118
+
#### Token Data type
119
+
120
+
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
+
122
+
To instantiate the class you are required to use the `Token::fromString` named constructor.
123
+
The class also exposes the complementat=ry public methods `Token::toString` as well as the `Token::toHttpValue` to enable its textual representation.
113
124
114
-
Item can be associated with that an ordered maps of key-value pairs called `Parameters`, where the
115
-
keys are strings and the value are bare items. Their public API will be cover in subsequent paragraphs.
116
125
117
-
#### Usage
126
+
#### Byte Sequence Data type
127
+
128
+
The Byte Sequence data type is a special string as defined in the RFC to represent base64 encoded data. To distinguish it from a normal string,
129
+
the `Bakame\Http\StructuredFields\ByteSequence` class is used.
130
+
131
+
To instantiate the class you are required to use the `ByteSequence::fromDecoded` or `ByteSequence::fromEncoded` named constructors.
132
+
The class also exposes the complementat=ry public methods `ByteSequence::decoded`, `ByteSequence::encoded` as well as
133
+
the `ByteSequence::toHttpValue` to enable its textual representation.
134
+
135
+
#### Usages
118
136
119
137
Instantiation via type recognition is done using the `Item::from` named constructor.
120
138
@@ -124,27 +142,33 @@ Instantiation via type recognition is done using the `Item::from` named construc
Conversely, the `Item::fromPair` is an alternative to the `Item::from`
135
153
which expects a tuple composed by an array as a list where:
136
154
137
155
- The first member on index `0` represents one of the six (6) item type value;
138
-
- 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;
156
+
- The second optional member, on index `1`, MUST be an iterable construct containing tuples of key-value pairs;
0 commit comments