You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -107,18 +109,19 @@ keys are string and the value are bare items. Their public API will be cover in
107
109
108
110
Instantiation via type recognition is done using the `Item::from` named constructor.
109
111
112
+
- The first argument represents one of the six (6) item type value;
113
+
- The second argument, which is optional, MUST be an iterable construct where its index represents the parameter key and its value an item or a item type value;
114
+
110
115
```php
111
116
use Bakame\Http\StructuredFields\Item;
112
117
113
118
$item = Item::from("hello world", ["a" => 1]);
114
119
$item->value(); //returns "hello world"
115
120
$item->isString(); //return true
116
121
$item->isToken(); //return false
117
-
$item->parameter("a")->value(); //returns 1
122
+
$item->parameter("a"); //returns 1
118
123
```
119
124
120
-
- The first argument represents one of the six (6) item type value;
121
-
- The second argument MUST be an iterable construct where its index represents the parameter key and its value an item or a item type value;
122
125
123
126
Once instantiated, accessing `Item` properties is done via three (3) methods:
0 commit comments