-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add RFC 8941 structured field parsing
- Loading branch information
Showing
12 changed files
with
804 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Amp\Http\StructuredFields; | ||
|
||
/** | ||
* @psalm-import-type Rfc8941Parameters from \Amp\Http\StructuredFields\Rfc8941 | ||
* @property-read bool $item | ||
* @template-extends Item<void> | ||
*/ | ||
class Boolean extends Item | ||
{ | ||
/** | ||
* @psalm-param Rfc8941Parameters $parameters | ||
*/ | ||
public function __construct(bool $item, array $parameters) | ||
{ | ||
parent::__construct($item, $parameters); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Amp\Http\StructuredFields; | ||
|
||
/** | ||
* @psalm-import-type Rfc8941Parameters from \Amp\Http\StructuredFields\Rfc8941 | ||
* @property-read string $item | ||
* @template-extends Item<void> | ||
*/ | ||
class Bytes extends Item | ||
{ | ||
/** | ||
* @psalm-param Rfc8941Parameters $parameters | ||
*/ | ||
public function __construct(string $item, array $parameters) | ||
{ | ||
parent::__construct($item, $parameters); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Amp\Http\StructuredFields; | ||
|
||
/** | ||
* @psalm-import-type Rfc8941Parameters from \Amp\Http\StructuredFields\Rfc8941 | ||
* @property-read int $item | ||
* @template-extends Item<void> | ||
*/ | ||
class Date extends Item | ||
{ | ||
/** | ||
* @psalm-param Rfc8941Parameters $parameters | ||
*/ | ||
public function __construct(int $item, array $parameters) | ||
{ | ||
parent::__construct($item, $parameters); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Amp\Http\StructuredFields; | ||
|
||
/** | ||
* @psalm-import-type Rfc8941Parameters from \Amp\Http\StructuredFields\Rfc8941 | ||
* @property-read string $item | ||
* @template-extends Item<void> | ||
*/ | ||
class DisplayString extends Item | ||
{ | ||
/** | ||
* @psalm-param Rfc8941Parameters $parameters | ||
*/ | ||
public function __construct(string $item, array $parameters) | ||
{ | ||
parent::__construct($item, $parameters); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Amp\Http\StructuredFields; | ||
|
||
/** | ||
* @psalm-import-type Rfc8941Parameters from \Amp\Http\StructuredFields\Rfc8941 | ||
* @property-read list<Item<void>> $item | ||
* @template-extends Item<list<Item<void>>> | ||
*/ | ||
class InnerList extends Item | ||
{ | ||
/** | ||
* @psalm-param list<Item<void>> $item | ||
* @psalm-param Rfc8941Parameters $parameters | ||
*/ | ||
public function __construct(array $item, array $parameters) | ||
{ | ||
parent::__construct($item, $parameters); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Amp\Http\StructuredFields; | ||
|
||
/** | ||
* @psalm-template Inner | ||
* @psalm-import-type Rfc8941Parameters from \Amp\Http\StructuredFields\Rfc8941 | ||
*/ | ||
class Item | ||
{ | ||
/** | ||
* @psalm-param int|float|string|bool|Inner $item | ||
Check failure on line 12 in src/StructuredFields/Item.php GitHub Actions / PHP 8.1MismatchingDocblockPropertyType
Check failure on line 12 in src/StructuredFields/Item.php GitHub Actions / PHP 8.2MismatchingDocblockPropertyType
|
||
* @psalm-param Rfc8941Parameters $parameters | ||
*/ | ||
protected function __construct(public readonly int|float|string|bool|array $item, public readonly array $parameters) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Amp\Http\StructuredFields; | ||
|
||
/** | ||
* @psalm-import-type Rfc8941Parameters from \Amp\Http\StructuredFields\Rfc8941 | ||
* @property-read int|float $item | ||
* @template-extends Item<void> | ||
*/ | ||
class Number extends Item | ||
{ | ||
/** | ||
* @psalm-param Rfc8941Parameters $parameters | ||
*/ | ||
public function __construct(int|float $item, array $parameters) | ||
{ | ||
parent::__construct($item, $parameters); | ||
} | ||
} |
Oops, something went wrong.