@@ -57,10 +57,8 @@ $list = StructuredFields\OrderedList::fromHttpValue('"/member/*/author", "/membe
57
57
echo $list->get(-1)->value; //returns '/member/*/comments'
58
58
~~~
59
59
60
- Documentation
61
- ---
62
-
63
- ### Parsing and Serializing Structured Fields
60
+ Parsing and Serializing Structured Fields
61
+ ------------
64
62
65
63
an HTTP field can be defined as:
66
64
@@ -87,11 +85,12 @@ $item = StructuredFields\Item::fromHttpValue('"foo";a=1;b=2"');
87
85
echo $item->toHttpValue(); // "foo";a=1;b=2
88
86
```
89
87
90
- ### Building Structured Fields
88
+ Building Structured Fields
89
+ ------------
91
90
92
- #### Items
91
+ ### Items
93
92
94
- ##### Bare Items
93
+ #### Bare Items
95
94
96
95
Items can have different types [ defined in the RFC] [ 3 ] . They are translated to PHP native type
97
96
when possible otherwise two additional classes
@@ -110,12 +109,12 @@ are used to represent non-native types as shown in the table below:
110
109
| Token | class ` Token ` | ` Item::isToken ` |
111
110
| Byte Sequence | class ` ByteSequence ` | ` Item::isByteSequence ` |
112
111
113
- ##### Items associated with parameters
112
+ #### Items with parameters
114
113
115
114
Item can be associated with that an ordered maps of key-value pairs called ` Parameters ` , where the
116
115
keys are strings and the value are bare items. Their public API will be cover in subsequent paragraphs.
117
116
118
- ##### Building and accessing Items data
117
+ #### Usage
119
118
120
119
Instantiation via type recognition is done using the ` Item::from ` named constructor.
121
120
@@ -167,7 +166,7 @@ $item->isDecimal(); //return false
167
166
$item->isInteger(); //return true
168
167
```
169
168
170
- #### Containers
169
+ ### Containers
171
170
172
171
Apart from the ` Item ` structure, the package exposes different containers
173
172
with different requirements via the following value objects:
@@ -200,7 +199,7 @@ $parameters->toHttpValue(); // returns ';a=1;b=2;c="hello world"'
200
199
$parameters->clear()->isEmpty(); // returns true
201
200
```
202
201
203
- ##### Ordered Maps
202
+ #### Ordered Maps
204
203
205
204
The ` Parameters ` and the ` Dictionary ` classes allow associating a string
206
205
key to its members
@@ -274,7 +273,7 @@ $parameters->toHttpValue(); // returns ;b="false";foo="foo"
274
273
$parameters->value('unknown'); // returns null
275
274
```
276
275
277
- ##### Lists
276
+ #### Lists
278
277
279
278
The ` OrderedList ` and the ` InnerList ` classes are list of members that act as containers
280
279
0 commit comments