Skip to content

Commit e77026c

Browse files
committed
Prepare first release
1 parent ce13570 commit e77026c

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
All notable changes to the package will be documented in this file.
44

5-
## [Next] - TBH
5+
## [0.1.0] - 2022-03-18
66

7-
First stable release of `bakame/http-structured-fields`
7+
**Initial release!**
88

9-
[Next]: https://github.com/bakame-php/http-structured-fields/compare/master...master
9+
[Next]: https://github.com/colinodell/indentation/compare/0.1.0...master
10+
[0.1.0]: https://github.com/colinodell/indentation/releases/tag/0.1.0

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ The package can be used to:
2020
```php
2121
use Bakame\Http\StructuredFields\Item;
2222

23-
$fields = Item::from("/terms", ['rel' => "copyright", 'anchor' => '#foo']));
24-
echo $fields->toHttpValue(); //display "/terms";rel="copyright";anchor="#foo"
23+
$field = Item::from("/terms", ['rel' => "copyright", 'anchor' => '#foo']);
24+
echo $field->toHttpValue(); //display "/terms";rel="copyright";anchor="#foo"
25+
echo $field->value(); //display "/terms"
26+
echo $field->parameter('rel'); //display "copyright"
2527
```
2628

2729
System Requirements
@@ -107,18 +109,19 @@ keys are string and the value are bare items. Their public API will be cover in
107109

108110
Instantiation via type recognition is done using the `Item::from` named constructor.
109111

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+
110115
```php
111116
use Bakame\Http\StructuredFields\Item;
112117

113118
$item = Item::from("hello world", ["a" => 1]);
114119
$item->value(); //returns "hello world"
115120
$item->isString(); //return true
116121
$item->isToken(); //return false
117-
$item->parameter("a")->value(); //returns 1
122+
$item->parameter("a"); //returns 1
118123
```
119124

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;
122125

123126
Once instantiated, accessing `Item` properties is done via three (3) methods:
124127

0 commit comments

Comments
 (0)