Skip to content

Commit

Permalink
Fix PhpStan errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek committed Jul 29, 2022
1 parent 7abd8db commit 831ac15
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/ApiManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ private function invokeActionMethod(
$httpCode = 200;
try {
$methodResponse = (new \ReflectionMethod($endpoint, $methodName))->invokeArgs($endpoint, $args);
/** @phpstan-ignore-next-line */
} catch (ThrowStatusResponse $statusResponse) {
$methodResponse = $statusResponse->getResponse();
$httpCode = $methodResponse->getHttpCode();
Expand Down
4 changes: 2 additions & 2 deletions src/Response/Status/SuccessResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Baraja\StructuredApi\Response;
use Baraja\StructuredApi\ThrowStatusResponse;

final class SuccessResponse extends StatusResponse
class SuccessResponse extends StatusResponse
{
/**
* @param array<string, mixed>|Response|StatusResponse $data
Expand Down Expand Up @@ -36,7 +36,7 @@ public static function invoke(
?int $code = null,
array|Response|StatusResponse $data = [],
): void {
ThrowStatusResponse::invoke(new self($state, $message, $code, $data));
ThrowStatusResponse::invoke(new static($state, $message, $code, $data));
}


Expand Down

0 comments on commit 831ac15

Please sign in to comment.