Skip to content

Commit

Permalink
Merge branch 'main' into authenticator
Browse files Browse the repository at this point in the history
  • Loading branch information
jenky committed Sep 30, 2024
2 parents 1fc329d + c0d55a0 commit efa39af
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/retype-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
contents: write

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: retypeapp/action-build@latest

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,6 @@ jobs:
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ composer.lock
coverage
phpunit.xml
psalm.xml
.php-cs-fixer.php
vendor
.php-cs-fixer.cache

1 change: 1 addition & 0 deletions src/Contracts/ConnectorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function middleware(): Middleware;
* The request and response should be processed through middleware.
*
* @template T of object
*
* @param Request<T> $request
* @return Response<T>
*/
Expand Down
5 changes: 3 additions & 2 deletions src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,12 @@ public function data(): array
*/
public function object(): ?object
{
if (! $this->decoder instanceof MapperInterface) {
if (! ($decoder = $this->decoder) instanceof MapperInterface) {
return null;
}

return $this->decoder->map($this->response); // @phpstan-ignore-line
/** @var MapperInterface<T> $decoder */
return $decoder->map($this->response);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/ConnectorTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function send(Request $request): Response
Util::request($request, static::baseUri())
);

return new Response($response, $request->decoder()); // @phpstan-ignore-line
return new Response($response, $request->decoder());
}

public function sendRequest(RequestInterface $request): ResponseInterface
Expand Down

0 comments on commit efa39af

Please sign in to comment.