Skip to content

Commit 7c1221f

Browse files
committed
Update documentation
1 parent ee2ef43 commit 7c1221f

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,8 @@ $list = StructuredFields\OrderedList::fromHttpValue('"/member/*/author", "/membe
5757
echo $list->get(-1)->value; //returns '/member/*/comments'
5858
~~~
5959

60-
Documentation
61-
---
62-
63-
### Parsing and Serializing Structured Fields
60+
Parsing and Serializing Structured Fields
61+
------------
6462

6563
an HTTP field can be defined as:
6664

@@ -87,11 +85,12 @@ $item = StructuredFields\Item::fromHttpValue('"foo";a=1;b=2"');
8785
echo $item->toHttpValue(); // "foo";a=1;b=2
8886
```
8987

90-
### Building Structured Fields
88+
Building Structured Fields
89+
------------
9190

92-
#### Items
91+
### Items
9392

94-
##### Bare Items
93+
#### Bare Items
9594

9695
Items can have different types [defined in the RFC][3]. They are translated to PHP native type
9796
when possible otherwise two additional classes
@@ -110,12 +109,12 @@ are used to represent non-native types as shown in the table below:
110109
| Token | class `Token` | `Item::isToken` |
111110
| Byte Sequence | class `ByteSequence` | `Item::isByteSequence` |
112111

113-
##### Items associated with parameters
112+
#### Items with parameters
114113

115114
Item can be associated with that an ordered maps of key-value pairs called `Parameters`, where the
116115
keys are strings and the value are bare items. Their public API will be cover in subsequent paragraphs.
117116

118-
##### Building and accessing Items data
117+
#### Usage
119118

120119
Instantiation via type recognition is done using the `Item::from` named constructor.
121120

@@ -167,7 +166,7 @@ $item->isDecimal(); //return false
167166
$item->isInteger(); //return true
168167
```
169168

170-
#### Containers
169+
### Containers
171170

172171
Apart from the `Item` structure, the package exposes different containers
173172
with different requirements via the following value objects:
@@ -200,7 +199,7 @@ $parameters->toHttpValue(); // returns ';a=1;b=2;c="hello world"'
200199
$parameters->clear()->isEmpty(); // returns true
201200
```
202201

203-
##### Ordered Maps
202+
#### Ordered Maps
204203

205204
The `Parameters` and the `Dictionary` classes allow associating a string
206205
key to its members
@@ -274,7 +273,7 @@ $parameters->toHttpValue(); // returns ;b="false";foo="foo"
274273
$parameters->value('unknown'); // returns null
275274
```
276275

277-
##### Lists
276+
#### Lists
278277

279278
The `OrderedList` and the `InnerList` classes are list of members that act as containers
280279

0 commit comments

Comments
 (0)