Skip to content

Commit c58035b

Browse files
committed
Apply updates PHPCSF rules
1 parent 01ae28e commit c58035b

File tree

4 files changed

+34
-14
lines changed

4 files changed

+34
-14
lines changed

src/Exceptions/ClientQueueEmpty.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ final class ClientQueueEmpty extends Exception implements ClientExceptionInterfa
1313
/**
1414
* @var string
1515
*/
16-
public const STRING_QUEUE_EMPTY_FOR_URI = 'The response queue is empty. Unable to resolve request for %s';
16+
public const STRING_QUEUE_EMPTY = 'The response queue is empty';
17+
1718
/**
1819
* @var string
1920
*/
20-
public const STRING_QUEUE_EMPTY = 'The response queue is empty';
21+
public const STRING_QUEUE_EMPTY_FOR_URI = 'The response queue is empty. Unable to resolve request for %s';
2122

2223
public function __construct(
2324
?string $requestMethodAndUri = null,

src/Exceptions/ClientRequestLimitSurpassed.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,50 @@
66

77
use Exception;
88
use Psr\Http\Client\ClientExceptionInterface;
9+
use function is_int;
910
use function is_string;
1011

1112
final class ClientRequestLimitSurpassed extends Exception implements ClientExceptionInterface
1213
{
13-
/**
14-
* @var string
15-
*/
16-
public const STRING_REQUEST_URI_WITH_LIMIT = 'The request limit of %d was surpassed for the request: %s';
1714
/**
1815
* @var string
1916
*/
2017
public const STRING_REQUEST_LIMIT = 'The request limit was surpassed for the request: %s';
18+
2119
/**
2220
* @var string
2321
*/
2422
public const STRING_REQUEST_LIMIT_WITHOUT_URI = 'The request limit of %d was surpassed';
23+
2524
/**
2625
* @var string
2726
*/
2827
public const STRING_REQUEST_LIMIT_WITHOUT_URI_AND_LIMIT = 'The request limit was surpassed';
2928

29+
/**
30+
* @var string
31+
*/
32+
public const STRING_REQUEST_URI_WITH_LIMIT = 'The request limit of %d was surpassed for the request: %s';
33+
3034
public function __construct(
3135
?string $requestMethodAndUri = null,
3236
?int $limit = null,
3337
) {
3438
if (is_string($requestMethodAndUri) && '' !== trim($requestMethodAndUri)) {
35-
if (\is_int($limit)) {
39+
if (is_int($limit)) {
3640
parent::__construct(sprintf(self::STRING_REQUEST_URI_WITH_LIMIT, $limit, trim($requestMethodAndUri)));
41+
3742
return;
3843
}
3944

4045
parent::__construct(sprintf(self::STRING_REQUEST_LIMIT, trim($requestMethodAndUri)));
46+
4147
return;
4248
}
4349

44-
if (\is_int($limit)) {
50+
if (is_int($limit)) {
4551
parent::__construct(sprintf(self::STRING_REQUEST_LIMIT_WITHOUT_URI, $limit));
52+
4653
return;
4754
}
4855

src/Exceptions/ClientRequestMissed.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,25 @@
1010

1111
final class ClientRequestMissed extends Exception implements ClientExceptionInterface
1212
{
13+
/**
14+
* @var string
15+
*/
16+
public const STRING_QUEUE_MISSED = 'There were no queued matching responses for the request';
17+
18+
/**
19+
* @var string
20+
*/
21+
public const STRING_QUEUE_MISSED_EMPTY_FOR_URI = 'There were no queued matching responses for the request: %s';
22+
1323
public function __construct(
1424
?string $requestMethodAndUri = null,
1525
) {
1626
if (is_string($requestMethodAndUri) && '' !== trim($requestMethodAndUri)) {
17-
parent::__construct(sprintf('There were no queued matching responses for the request: %s', trim($requestMethodAndUri)));
27+
parent::__construct(sprintf(self::STRING_QUEUE_MISSED_EMPTY_FOR_URI, trim($requestMethodAndUri)));
1828

1929
return;
2030
}
2131

22-
parent::__construct('There were no queued matching responses for the request');
32+
parent::__construct(self::STRING_QUEUE_MISSED);
2333
}
2434
}

src/Exceptions/ClientTotalRequestLimitSurpassed.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,26 @@
66

77
use Exception;
88
use Psr\Http\Client\ClientExceptionInterface;
9-
use function is_string;
9+
use function is_int;
1010

1111
final class ClientTotalRequestLimitSurpassed extends Exception implements ClientExceptionInterface
1212
{
1313
/**
1414
* @var string
1515
*/
16-
public const STRING_REACHED_WITH_LIMIT = 'The request limit of %d was surpassed';
16+
public const STRING_REACHED = 'The request limit was surpassed';
17+
1718
/**
1819
* @var string
1920
*/
20-
public const STRING_REACHED = 'The request limit was surpassed';
21+
public const STRING_REACHED_WITH_LIMIT = 'The request limit of %d was surpassed';
2122

2223
public function __construct(
2324
?int $limit = null,
2425
) {
25-
if (\is_int($limit)) {
26+
if (is_int($limit)) {
2627
parent::__construct(sprintf(self::STRING_REACHED_WITH_LIMIT, $limit));
28+
2729
return;
2830
}
2931

0 commit comments

Comments
 (0)