Skip to content

Commit

Permalink
run php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldyrynda committed Apr 13, 2024
1 parent 9329464 commit 1c989ef
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Response
/**
* Create a new response instance.
*/
public function __construct(ResponseInterface $psrResponse, PendingRequest $pendingRequest, RequestInterface $psrRequest, Throwable $senderException = null)
public function __construct(ResponseInterface $psrResponse, PendingRequest $pendingRequest, RequestInterface $psrRequest, ?Throwable $senderException = null)
{
$this->psrRequest = $psrRequest;
$this->psrResponse = $psrResponse;
Expand Down Expand Up @@ -193,7 +193,7 @@ public function getSenderException(): ?Throwable
/**
* Get the JSON decoded body of the response as an array or scalar value.
*
* @param array-key|null $key
* @param array-key|null $key
* @return ($key is null ? array<array-key, mixed> : mixed)
*/
public function json(string|int|null $key = null, mixed $default = null): mixed
Expand All @@ -214,7 +214,7 @@ public function json(string|int|null $key = null, mixed $default = null): mixed
*
* Alias of json()
*
* @param array-key|null $key
* @param array-key|null $key
* @return ($key is null ? array<array-key, mixed> : mixed)
*/
public function array(int|string|null $key = null, mixed $default = null): mixed
Expand Down Expand Up @@ -265,9 +265,10 @@ public function xmlReader(): XmlReader
* Get the JSON decoded body of the response as a collection.
*
* Requires Laravel Collections (composer require illuminate/collections)
*
* @see https://github.com/illuminate/collections
*
* @param array-key|null $key
* @param array-key|null $key
* @return \Illuminate\Support\Collection<array-key, mixed>
*/
public function collect(string|int|null $key = null): Collection
Expand All @@ -289,6 +290,7 @@ public function collect(string|int|null $key = null): Collection
* Cast the response to a DTO.
*
* @template T of object
*
* @return ($dto is class-string<T> ? T : object)
*/
public function dto(?string $dto = null): mixed
Expand All @@ -309,6 +311,7 @@ public function dto(?string $dto = null): mixed
* Convert the response into a DTO or throw a LogicException if the response failed
*
* @template T of object
*
* @return ($dto is class-string<T> ? T : object)
*/
public function dtoOrFail(?string $dto = null): mixed
Expand Down Expand Up @@ -400,7 +403,7 @@ public function serverError(): bool
/**
* Execute the given callback if there was a server or client error.
*
* @param callable($this): (void) $callback
* @param callable($this): (void) $callback
* @return $this
*/
public function onError(callable $callback): static
Expand Down Expand Up @@ -460,6 +463,7 @@ protected function createException(): Throwable
* Throw an exception if a server or client error occurred.
*
* @return $this
*
* @throws \Throwable
*/
public function throw(): static
Expand Down Expand Up @@ -504,7 +508,7 @@ public function getRawStream(): mixed
/**
* Save the body to a file
*
* @param string|resource $resourceOrPath
* @param string|resource $resourceOrPath
*/
public function saveBodyToFile(mixed $resourceOrPath, bool $closeResource = true): void
{
Expand Down

0 comments on commit 1c989ef

Please sign in to comment.