Skip to content

Commit 2be17ff

Browse files
committed
Improve documentation and docblocks
1 parent 6ac3a01 commit 2be17ff

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ The package can be used to:
2323
use Bakame\Http\StructuredFields;
2424

2525
$field = StructuredFields\Item::from("/terms", ['rel' => 'copyright', 'anchor' => '#foo']);
26-
echo $field->toHttpValue(); // display "/terms";rel="copyright";anchor="#foo"
27-
echo $field->value(); // display "/terms"
28-
echo $field->parameters->value('rel'); // display "copyright"
26+
echo $field->toHttpValue(); // display "/terms";rel="copyright";anchor="#foo"
27+
echo $field->value(); // display "/terms"
28+
echo $field->parameters['rel']->value(); // display "copyright"
2929
```
3030

3131
System Requirements

docs/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ The package can be used to:
2323
use Bakame\Http\StructuredFields;
2424

2525
$field = StructuredFields\Item::from("/terms", ['rel' => 'copyright', 'anchor' => '#foo']);
26-
echo $field->toHttpValue(); // display "/terms";rel="copyright";anchor="#foo"
27-
echo $field->value(); // display "/terms"
28-
echo $field->parameters->value('rel'); // display "copyright"
26+
echo $field->toHttpValue(); // display "/terms";rel="copyright";anchor="#foo"
27+
echo $field->value(); // display "/terms"
28+
echo $field->parameters['rel']->value(); // display "copyright"
2929
```
3030

3131
System Requirements

docs/item.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,13 @@ same argument definition as in `Item::from` for parameters argument.
9191
use Bakame\Http\StructuredFields;
9292

9393
$item = StructuredFields\Item::fromPair([
94-
"hello world",
95-
[
94+
"hello world", [
9695
["a", StructuredFields\ByteSequence::fromDecoded("Hello World")],
9796
]
9897
]);
99-
$item->value(); // returns "hello world"
98+
$item->value(); // returns "hello world"
10099
$item->isString(); // returns true
101-
$item->parameters->get("a")->isByteSequence(); // returns true
100+
$item->parameters["a"]->isByteSequence(); // returns true
102101
$item->parameters->value("a"); // returns the decoded value 'Hello World'
103102
echo $item->toHttpValue(); // returns "hello world";a=:SGVsbG8gV29ybGQ=:
104103
```
@@ -120,7 +119,7 @@ use Bakame\Http\StructuredFields;
120119

121120
$item = StructuredFields\Item::from(StructuredFields\ByteSequence::fromEncoded("SGVsbG8gV29ybGQ=")]);
122121
$item->isByteSequence(); // returns true
123-
echo $item->value(); // returns the decoded value 'Hello World'
122+
echo $item->value(); // returns the decoded value 'Hello World'
124123
```
125124

126125
**Of note: to instantiate a decimal number type a float MUST be used as the first argument of `Item::from`.**

src/ParameterAccess.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Bakame\Http\StructuredFields;
66

77
/**
8-
* @property-read OrderedMap<string, StructuredField> $parameters
8+
* @property-read OrderedMap<string, Item> $parameters
99
*/
1010
interface ParameterAccess
1111
{

0 commit comments

Comments
 (0)