Skip to content

Commit 00c60c9

Browse files
committed
🚿
1 parent 3bcdeb5 commit 00c60c9

File tree

6 files changed

+12
-5
lines changed

6 files changed

+12
-5
lines changed

src/Psr15/MiddlewareException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@
1212

1313
namespace chillerlan\HTTP\Psr15;
1414

15-
class MiddlewareException extends \Exception{}
15+
use Exception;
16+
17+
class MiddlewareException extends Exception{}

src/Psr15/PriorityQueueRequestHandler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
namespace chillerlan\HTTP\Psr15;
1616

1717
use Psr\Http\Server\MiddlewareInterface;
18+
use function usort;
1819

1920
class PriorityQueueRequestHandler extends QueueRequestHandler{
2021

@@ -61,7 +62,7 @@ public function add(MiddlewareInterface $middleware):QueueRequestHandler{
6162
* @return void
6263
*/
6364
protected function sortMiddleware():void{
64-
\usort($this->middlewareStack, function(PriorityMiddlewareInterface $a, PriorityMiddlewareInterface $b){
65+
usort($this->middlewareStack, function(PriorityMiddlewareInterface $a, PriorityMiddlewareInterface $b){
6566
return $a->getPriority() < $b->getPriority();
6667
});
6768
}

src/Psr18/ClientException.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
namespace chillerlan\HTTP\Psr18;
1414

15+
use Exception;
1516
use Psr\Http\Client\ClientExceptionInterface;
1617

17-
class ClientException extends \Exception implements ClientExceptionInterface{}
18+
class ClientException extends Exception implements ClientExceptionInterface{}

src/Psr18/LoggingClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
namespace chillerlan\HTTP\Psr18;
1616

1717
use Psr\Http\Client\{ClientExceptionInterface, ClientInterface};
18-
use Psr\Http\Message\{RequestInterface, ResponseFactoryInterface, ResponseInterface};
18+
use Psr\Http\Message\{RequestInterface, ResponseInterface};
1919
use Psr\Log\{LoggerAwareInterface, LoggerAwareTrait, LoggerInterface, NullLogger};
2020
use Throwable;
2121

src/Psr18/URLExtractor.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
use chillerlan\HTTP\Psr7\Request;
1616
use Psr\Http\Message\{RequestInterface, ResponseInterface};
1717

18+
use function in_array;
19+
1820
class URLExtractor extends CurlClient{
1921

2022
/**
@@ -32,7 +34,7 @@ public function sendRequest(RequestInterface $request):ResponseInterface{
3234
$request = new Request($request->getMethod(), $response->getHeaderLine('location'));
3335
$this->responses[] = $response;
3436
}
35-
while(\in_array($response->getStatusCode(), [301, 302, 303, 307, 308], true));
37+
while(in_array($response->getStatusCode(), [301, 302, 303, 307, 308], true));
3638

3739
return $response;
3840
}

src/Psr7/Uri.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ protected function parseUriParts(array $parts):void{
505505
* @return string
506506
*/
507507
protected function replaceChars(string $str, bool $query = null):string{
508+
/** @noinspection RegExpRedundantEscape */
508509
return preg_replace_callback(
509510
'/(?:[^a-z\d_\-\.~!\$&\'\(\)\*\+,;=%:@\/'.($query ? '\?' : '').']++|%(?![a-f\d]{2}))/i',
510511
function(array $match):string{

0 commit comments

Comments
 (0)