Skip to content

Commit fa589c0

Browse files
committed
Update from 'Structured Headers' to 'Structured Fields'
- Update namespace and create compatibility classes - Update composer.json - Update Readme
1 parent f986d71 commit fa589c0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+149
-70
lines changed

composer.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "gapple/structured-headers",
3-
"description": "Parser for Structured Headers for HTTP",
2+
"name": "gapple/structured-fields",
3+
"description": "Parser for Structured Field Values for HTTP",
44
"type": "library",
55
"license": [
66
"MIT",
@@ -12,13 +12,14 @@
1212
}
1313
],
1414
"support": {
15-
"source": "https://github.com/gapple/structured-headers",
16-
"issues": "https://github.com/gapple/structured-headers/issues"
15+
"source": "https://github.com/gapple/structured-fields",
16+
"issues": "https://github.com/gapple/structured-fields/issues"
1717
},
1818
"autoload": {
1919
"psr-4": {
20-
"gapple\\StructuredHeaders\\": "src/",
21-
"gapple\\Tests\\StructuredHeaders\\": "tests/"
20+
"gapple\\StructuredFields\\": "src/",
21+
"gapple\\Tests\\StructuredFields\\": "tests/",
22+
"gapple\\StructuredHeaders\\": "src/headers-compat"
2223
}
2324
},
2425
"scripts": {

phpcs.xml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<ruleset name="structured-headers">
3-
<description>Default PHP CodeSniffer configuration for gapple/structured-headers.</description>
2+
<ruleset name="structured-fields">
3+
<description>Default PHP CodeSniffer configuration for gapple/structured-fields.</description>
44

55
<file>src</file>
66
<file>tests</file>

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
failOnWarning="true"
77
>
88
<testsuites>
9-
<testsuite name="structured-headers tests">
9+
<testsuite name="structured-fields tests">
1010
<directory>./tests/</directory>
1111
</testsuite>
1212
</testsuites>

readme.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
Structured Headers parser for PHP
1+
Structured Field Values Parser for PHP
22
=======================================
33

4-
Parser and serializer for the [Structured Headers for HTTP][1] specification.
4+
Parser and serializer for the [Structured Field Values for HTTP][1] specification.
55

6-
[![Build Status](https://github.com/gapple/structured-headers/workflows/PHP%20Composer/badge.svg)](https://github.com/gapple/structured-headers/actions)
7-
[![codecov](https://codecov.io/gh/gapple/structured-headers/branch/master/graph/badge.svg)](https://codecov.io/gh/gapple/structured-headers)
6+
[![Build Status](https://github.com/gapple/structured-fields/workflows/PHP%20Composer/badge.svg)](https://github.com/gapple/structured-fields/actions)
7+
[![codecov](https://codecov.io/gh/gapple/structured-fields/branch/master/graph/badge.svg)](https://codecov.io/gh/gapple/structured-fields)
88

99

1010
Installation
@@ -13,7 +13,7 @@ Installation
1313
Using composer:
1414

1515
```
16-
composer require gapple/structured-headers
16+
composer require gapple/structured-fields
1717
```
1818

1919
API
@@ -24,7 +24,7 @@ API
2424
The `Parser::parseItem()` method returns a `[value, parameters]` tuple.
2525

2626
```php
27-
print_r(\gapple\StructuredHeaders\Parser::parseItem("42"));
27+
print_r(\gapple\StructuredFields\Parser::parseItem("42"));
2828

2929
// Array
3030
// (
@@ -40,7 +40,7 @@ print_r(\gapple\StructuredHeaders\Parser::parseItem("42"));
4040
The `Parser::parseList()` method returns an array of `[value, parameters]` tuples.
4141

4242
```php
43-
print_r(\gapple\StructuredHeaders\Parser::parseList("1, 42;towel;panic=?0"));
43+
print_r(\gapple\StructuredFields\Parser::parseList("1, 42;towel;panic=?0"));
4444

4545
// Array
4646
// (
@@ -68,7 +68,7 @@ print_r(\gapple\StructuredHeaders\Parser::parseList("1, 42;towel;panic=?0"));
6868
The `Parser::parseDictionary()` method returns a `\stdClass` object with `[value, parameters]` tuples.
6969

7070
```php
71-
print_r(\gapple\StructuredHeaders\Parser::parseDictionary("towel, panic=?0"));
71+
print_r(\gapple\StructuredFields\Parser::parseDictionary("towel, panic=?0"));
7272

7373
// stdClass Object
7474
// (
@@ -95,16 +95,16 @@ print_r(\gapple\StructuredHeaders\Parser::parseDictionary("towel, panic=?0"));
9595
The `Serializer::serializeItem()` method.
9696

9797
```php
98-
print_r(\gapple\StructuredHeaders\Serializer::serializeItem(true));
98+
print_r(\gapple\StructuredFields\Serializer::serializeItem(true));
9999
// ?1
100100

101-
print_r(\gapple\StructuredHeaders\Serializer::serializeItem(42));
101+
print_r(\gapple\StructuredFields\Serializer::serializeItem(42));
102102
// 42
103103

104-
print_r(\gapple\StructuredHeaders\Serializer::serializeItem("42"));
104+
print_r(\gapple\StructuredFields\Serializer::serializeItem("42"));
105105
// "42"
106106

107-
print_r(\gapple\StructuredHeaders\Serializer::serializeItem(new \gapple\StructuredHeaders\Bytes('🙂')));
107+
print_r(\gapple\StructuredHeStructuredFieldsaders\Serializer::serializeItem(new \gapple\StructuredFields\Bytes('🙂')));
108108
// :8J+Zgg==:
109109
```
110110

@@ -113,7 +113,7 @@ print_r(\gapple\StructuredHeaders\Serializer::serializeItem(new \gapple\Structur
113113
The `Serializer::serializeList()` method.
114114

115115
```php
116-
print_r(\gapple\StructuredHeaders\Serializer::serializeList([
116+
print_r(\gapple\StructuredFields\Serializer::serializeList([
117117
[1, (object) []],
118118
[42, (object) ['towel' => true, 'panic' => false]],
119119
]));
@@ -126,7 +126,7 @@ print_r(\gapple\StructuredHeaders\Serializer::serializeList([
126126
The `Serializer::serializeDictionary()` method.
127127

128128
```php
129-
print_r(\gapple\StructuredHeaders\Serializer::serializeDictionary((object) [
129+
print_r(\gapple\StructuredFields\Serializer::serializeDictionary((object) [
130130
'towel' => [true, (object) []],
131131
'panic' => [false, (object) []],
132132
]));

src/Bytes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace gapple\StructuredHeaders;
3+
namespace gapple\StructuredFields;
44

55
class Bytes
66
{

src/ParseException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace gapple\StructuredHeaders;
3+
namespace gapple\StructuredFields;
44

55
class ParseException extends \RuntimeException
66
{

src/Parser.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace gapple\StructuredHeaders;
3+
namespace gapple\StructuredFields;
44

55
class Parser
66
{
@@ -152,7 +152,7 @@ private static function doParseItem(string &$string): array
152152
/**
153153
* @param string $string
154154
*
155-
* @return bool|float|int|string|\gapple\StructuredHeaders\Bytes|\gapple\StructuredHeaders\Token
155+
* @return bool|float|int|string|\gapple\StructuredFields\Bytes|\gapple\StructuredFields\Token
156156
*/
157157
private static function parseBareItem(string &$string)
158158
{
@@ -294,7 +294,7 @@ private static function parseToken(string &$string): Token
294294
*
295295
* @param string $string
296296
*
297-
* @return \gapple\StructuredHeaders\Bytes
297+
* @return \gapple\StructuredFields\Bytes
298298
*/
299299
private static function parseByteSequence(string &$string): Bytes
300300
{

src/SerializeException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace gapple\StructuredHeaders;
3+
namespace gapple\StructuredFields;
44

55
class SerializeException extends \RuntimeException
66
{

src/Serializer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace gapple\StructuredHeaders;
3+
namespace gapple\StructuredFields;
44

55
class Serializer
66
{

src/Token.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace gapple\StructuredHeaders;
3+
namespace gapple\StructuredFields;
44

55
class Token
66
{

0 commit comments

Comments
 (0)