Skip to content

Commit ddc5b9c

Browse files
committed
Update Documentation
1 parent 21db6e9 commit ddc5b9c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ $item = StructuredFields\Item::fromHttpValue('"foo";a=1;b=2"');
7373
echo $item->toHttpValue(); // "foo";a=1;b=2
7474
```
7575

76-
## Structured Fields Data Types
76+
## Building Structured Fields
7777

7878
The RFC defines different data types to handle structured fields values.
7979

@@ -124,7 +124,7 @@ $item->parameters->value("a"); //returns 1
124124
```
125125

126126
Conversely, the `Item::fromPair` is an alternative to the `Item::from`
127-
which expects a tuple composed by an array as w list where:
127+
which expects a tuple composed by an array as a list where:
128128

129129
- The first member on index `0` represents one of the six (6) item type value;
130130
- 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;
@@ -179,9 +179,9 @@ At any given time it is possible with each of these objects to:
179179
use Bakame\Http\StructuredFields;
180180

181181
$parameters = StructuredFields\Parameters::fromAssociative(['a' => 1, 'b' => 2, 'c' => "hello world"]);
182-
count($parameters); // return 2
182+
count($parameters); // return 3
183183
$parameters->isEmpty(); // returns false
184-
$parameters->toHttpValue(); // return ";a=1;b=2"
184+
$parameters->toHttpValue(); // return ';a=1;b=2;c="hello world"'
185185
```
186186

187187
#### Ordered Maps
@@ -220,10 +220,10 @@ $dictionary
220220
->prepend('a', false)
221221
->toHttpValue(); //returns "a=?0, b, c;foo=bar"
222222

223-
$dictionary->has('a'); //return true
224-
$dictionary->has('foo'); //return false
225-
$dictionary->pair(1); //return ['b', Item::fromBoolean(true)]
226-
$dictionary->hasPair(-1); //return true
223+
$dictionary->has('a'); //return true
224+
$dictionary->has('foo'); //return false
225+
$dictionary->pair(1); //return ['b', Item::fromBoolean(true)]
226+
$dictionary->hasPair(-1); //return true
227227

228228
echo $dictionary
229229
->append('z', 42.0)

0 commit comments

Comments
 (0)