Skip to content

Commit

Permalink
Move Rfc7230 to a Http1 sub-namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Mar 5, 2023
1 parent b9f04ee commit 9e9748b
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 11 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Every header line must end with `\r\n`, also the last one.
```php
<?php

use Amp\Http\Rfc7230;
use Amp\Http\Http1\Rfc7230;

require __DIR__ . "/../vendor/autoload.php";

Expand Down Expand Up @@ -162,8 +162,7 @@ It protects against header injections and other non-compliant header names and v
```php
<?php

use Amp\Http\Cookie\ResponseCookie;
use Amp\Http\Rfc7230;
use Amp\Http\Cookie\ResponseCookie;use Amp\Http\Http1\Rfc7230;

require __DIR__ . "/../vendor/autoload.php";

Expand Down
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
"src/Internal/constants.php"
]
},
"autoload-dev": {
"psr-4": {
"Amp\\Http\\": "test"
}
},
"require": {
"php": ">=8.1",
"amphp/hpack": "^3",
Expand Down
4 changes: 2 additions & 2 deletions examples/benchmark/format-rfc7230.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Amp\Http\Rfc7230;
use Amp\Http\Http1\Rfc7230;

require __DIR__ . "/../../vendor/autoload.php";

Expand All @@ -11,7 +11,7 @@
Content-Length: 0
X-No-Value:
X-No-Whitespace: Test
X-Trailing-Whitespace: Foobar
X-Trailing-Whitespace: Foobar
";

// Normalize line endings, which might be broken by Git otherwise
Expand Down
4 changes: 2 additions & 2 deletions examples/benchmark/parser-rfc7230.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Amp\Http\Rfc7230;
use Amp\Http\Http1\Rfc7230;

require __DIR__ . "/../../vendor/autoload.php";

Expand All @@ -11,7 +11,7 @@
Content-Length: 0
X-No-Value:
X-No-Whitespace: Test
X-Trailing-Whitespace: Foobar
X-Trailing-Whitespace: Foobar
";

// Normalize line endings, which might be broken by Git otherwise
Expand Down
2 changes: 1 addition & 1 deletion examples/header-format.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php declare(strict_types=1);

use Amp\Http\Cookie\ResponseCookie;
use Amp\Http\Rfc7230;
use Amp\Http\Http1\Rfc7230;

require __DIR__ . "/../vendor/autoload.php";

Expand Down
2 changes: 1 addition & 1 deletion examples/header-parsing.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Amp\Http\Rfc7230;
use Amp\Http\Http1\Rfc7230;

require __DIR__ . "/../vendor/autoload.php";

Expand Down
3 changes: 2 additions & 1 deletion src/Rfc7230.php → src/Http1/Rfc7230.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php declare(strict_types=1);

namespace Amp\Http;
namespace Amp\Http\Http1;

use Amp\Http\InvalidHeaderException;
use const Amp\Http\Internal\HEADER_LOWERCASE_MAP;

/**
Expand Down
3 changes: 2 additions & 1 deletion test/Rfc7230Test.php → test/Http1/Rfc7230Test.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php declare(strict_types=1);

namespace Amp\Http;
namespace Amp\Http\Http1;

use Amp\Http\InvalidHeaderException;
use PHPUnit\Framework\TestCase;

class Rfc7230Test extends TestCase
Expand Down

0 comments on commit 9e9748b

Please sign in to comment.