File tree Expand file tree Collapse file tree 4 files changed +11
-12
lines changed Expand file tree Collapse file tree 4 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -23,9 +23,9 @@ The package can be used to:
23
23
use Bakame\Http\StructuredFields;
24
24
25
25
$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"
29
29
```
30
30
31
31
System Requirements
Original file line number Diff line number Diff line change @@ -23,9 +23,9 @@ The package can be used to:
23
23
use Bakame\Http\StructuredFields;
24
24
25
25
$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"
29
29
```
30
30
31
31
System Requirements
Original file line number Diff line number Diff line change @@ -91,14 +91,13 @@ same argument definition as in `Item::from` for parameters argument.
91
91
use Bakame\Http\StructuredFields;
92
92
93
93
$item = StructuredFields\Item::fromPair([
94
- "hello world",
95
- [
94
+ "hello world", [
96
95
["a", StructuredFields\ByteSequence::fromDecoded("Hello World")],
97
96
]
98
97
]);
99
- $item->value(); // returns "hello world"
98
+ $item->value(); // returns "hello world"
100
99
$item->isString(); // returns true
101
- $item->parameters->get( "a") ->isByteSequence(); // returns true
100
+ $item->parameters[ "a"] ->isByteSequence(); // returns true
102
101
$item->parameters->value("a"); // returns the decoded value 'Hello World'
103
102
echo $item->toHttpValue(); // returns "hello world";a=:SGVsbG8gV29ybGQ=:
104
103
```
@@ -120,7 +119,7 @@ use Bakame\Http\StructuredFields;
120
119
121
120
$item = StructuredFields\Item::from(StructuredFields\ByteSequence::fromEncoded("SGVsbG8gV29ybGQ=")]);
122
121
$item->isByteSequence(); // returns true
123
- echo $item->value(); // returns the decoded value 'Hello World'
122
+ echo $item->value(); // returns the decoded value 'Hello World'
124
123
```
125
124
126
125
** Of note: to instantiate a decimal number type a float MUST be used as the first argument of ` Item::from ` .**
Original file line number Diff line number Diff line change 5
5
namespace Bakame \Http \StructuredFields ;
6
6
7
7
/**
8
- * @property-read OrderedMap<string, StructuredField > $parameters
8
+ * @property-read OrderedMap<string, Item > $parameters
9
9
*/
10
10
interface ParameterAccess
11
11
{
You can’t perform that action at this time.
0 commit comments