Skip to content

Commit 054994c

Browse files
Fix issues caught by static analysis tests.
1 parent 276ad24 commit 054994c

File tree

8 files changed

+13
-10
lines changed

8 files changed

+13
-10
lines changed

src/Api/Attachment.php

+3-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@
1212
namespace Mailgun\Api;
1313

1414
use Mailgun\Assert;
15-
use Mailgun\Exception\{
16-
HttpClientException,
17-
HttpServerException,
18-
UnknownErrorException
19-
};
15+
use Mailgun\Exception\HttpClientException;
16+
use Mailgun\Exception\HttpServerException;
17+
use Mailgun\Exception\UnknownErrorException;
2018
use Psr\Http\Message\ResponseInterface;
2119

2220
/**

src/Api/HttpApi.php

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ protected function hydrateResponse(ResponseInterface $response, string $class)
8282
* Throw the correct exception for this error.
8383
*
8484
* @throws HttpClientException|HttpServerException|UnknownErrorException
85+
*
8586
* @return never
8687
*/
8788
protected function handleErrors(ResponseInterface $response): void

src/Assert.php

+3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
final class Assert extends \Webmozart\Assert\Assert
2222
{
2323
/**
24+
* @psalm-pure
25+
*
2426
* @throws InvalidArgumentException
27+
*
2528
* @return never
2629
*/
2730
protected static function reportInvalidArgument($message): void

src/HttpClient/RequestBuilder.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ private function createRequest(
130130
string $uri,
131131
array $headers,
132132
StreamInterface $stream
133-
): RequestInterface
134-
{
133+
): RequestInterface {
135134
$request = $this->getRequestFactory()->createRequest($method, $uri);
136135
$request = $request->withBody($stream);
137136
foreach ($headers as $name => $value) {

src/Hydrator/ModelHydrator.php

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ final class ModelHydrator implements Hydrator
2626
* @param class-string $class
2727
*
2828
* @throws HydrationException
29+
*
2930
* @return ResponseInterface
3031
*/
3132
public function hydrate(ResponseInterface $response, string $class)

src/Hydrator/NoopHydrator.php

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ final class NoopHydrator implements Hydrator
2424
* @param class-string $class
2525
*
2626
* @throws \LogicException
27+
*
2728
* @return never
2829
*/
2930
public function hydrate(ResponseInterface $response, string $class)

src/Message/Exceptions/LimitExceeded.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
class LimitExceeded extends \Exception implements Exception
1717
{
18-
public static function create(string $field, int $limit): self
18+
public static function create(string $field, int $limit)
1919
{
2020
return new self(sprintf('You\'ve exceeded the maximum (%d) %s for a single message.', $limit, $field));
2121
}

src/Message/Exceptions/TooManyRecipients.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616

1717
class TooManyRecipients extends LimitExceeded implements Exception
1818
{
19-
public static function create(string $field, int $limit = MessageBuilder::RECIPIENT_COUNT_LIMIT): self
19+
public static function create(string $field, int $limit = MessageBuilder::RECIPIENT_COUNT_LIMIT)
2020
{
2121
return new self(sprintf('You\'ve exceeded the maximum recipient count (%s) for filed "%s".', $limit, $field));
2222
}
2323

24-
public static function whenAutoSendDisabled(int $limit = MessageBuilder::RECIPIENT_COUNT_LIMIT): self
24+
public static function whenAutoSendDisabled(int $limit = MessageBuilder::RECIPIENT_COUNT_LIMIT)
2525
{
2626
return new self(sprintf('You\'ve exceeded the maximum recipient count (%s) with autosend disabled.', $limit));
2727
}

0 commit comments

Comments
 (0)