Skip to content

Commit 337b628

Browse files
ksassnowskigithub-actions[bot]
authored andcommitted
Apply php-cs-fixer changes
1 parent 8094704 commit 337b628

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

src/Downloader/Middleware/RequestDeduplicationMiddleware.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
use Psr\Log\LoggerInterface;
1717
use RoachPHP\Http\Request;
1818
use RoachPHP\Support\Configurable;
19-
use const HTTP_URL_REPLACE;
20-
use const HTTP_URL_STRIP_FRAGMENT;
21-
use const HTTP_URL_STRIP_QUERY;
2219

2320
final class RequestDeduplicationMiddleware implements RequestMiddlewareInterface
2421
{
@@ -36,19 +33,19 @@ public function __construct(private LoggerInterface $logger)
3633
public function handleRequest(Request $request): Request
3734
{
3835
$uri = $request->getUri();
39-
$replaceFlags = HTTP_URL_REPLACE;
36+
$replaceFlags = \HTTP_URL_REPLACE;
4037
$parts = \parse_url($uri);
4138

4239
if ($this->option('ignore_url_fragments')) {
43-
$replaceFlags |= HTTP_URL_STRIP_FRAGMENT;
40+
$replaceFlags |= \HTTP_URL_STRIP_FRAGMENT;
4441
}
4542

4643
if ($this->option('ignore_trailing_slashes') && isset($parts['path'])) {
4744
$parts['path'] = \rtrim($parts['path'], '/');
4845
}
4946

5047
if ($this->option('ignore_query_string')) {
51-
$replaceFlags |= HTTP_URL_STRIP_QUERY;
48+
$replaceFlags |= \HTTP_URL_STRIP_QUERY;
5249
}
5350

5451
$uri = http_build_url($uri, $parts, $replaceFlags);

src/Downloader/Middleware/RobotsTxtMiddleware.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
use RoachPHP\Http\Request;
1717
use RoachPHP\Support\Configurable;
1818
use Spatie\Robots\Robots;
19-
use const PHP_URL_HOST;
20-
use const PHP_URL_PORT;
21-
use const PHP_URL_SCHEME;
2219

2320
final class RobotsTxtMiddleware implements RequestMiddlewareInterface
2421
{
@@ -51,9 +48,9 @@ public function handleRequest(Request $request): Request
5148

5249
private function createRobotsUrl(string $url): string
5350
{
54-
$robotsUrl = \parse_url($url, PHP_URL_SCHEME) . '://' . \parse_url($url, PHP_URL_HOST);
51+
$robotsUrl = \parse_url($url, \PHP_URL_SCHEME) . '://' . \parse_url($url, \PHP_URL_HOST);
5552

56-
$port = \parse_url($url, PHP_URL_PORT);
53+
$port = \parse_url($url, \PHP_URL_PORT);
5754

5855
if (null !== $port && false !== $port) {
5956
$robotsUrl .= ":{$port}";

tests/IntegrationTestCase.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
namespace RoachPHP\Tests;
1515

1616
use PHPUnit\Framework\TestCase;
17-
use const JSON_THROW_ON_ERROR;
1817

1918
/**
2019
* @internal
@@ -69,7 +68,7 @@ private function getCrawledRoutes(): array
6968
$response,
7069
true,
7170
512,
72-
JSON_THROW_ON_ERROR,
71+
\JSON_THROW_ON_ERROR,
7372
);
7473
}
7574
}

0 commit comments

Comments
 (0)