Skip to content

Commit

Permalink
laravel 10
Browse files Browse the repository at this point in the history
  • Loading branch information
recca0120 committed Feb 15, 2023
1 parent 1eecfc4 commit 1113f31
Show file tree
Hide file tree
Showing 13 changed files with 126 additions and 114 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [ '7.2', '7.3', '7.4', '8.0', '8.1' ]
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
stability: [ prefer-stable ]

name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"require-dev": {
"mockery/mockery": "^0.9|^1.3",
"orchestra/testbench": "^5.19|^6.18|^7.0",
"orchestra/testbench": "^5.19|^6.18|^7.0|^8.0",
"phpunit/phpunit": "^8.5|^9.1"
},
"autoload": {
Expand Down
9 changes: 6 additions & 3 deletions src/BatchRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ class BatchRequest
* @var ParallelRequest
*/
private $request;

/**
* @var int
*/
private $times;

/**
* @var string[]
*/
Expand All @@ -67,8 +69,9 @@ class BatchRequest

/**
* Batch constructor.
* @param ParallelRequest $request
* @param int $times
*
* @param ParallelRequest $request
* @param int $times
*/
public function __construct(ParallelRequest $request, int $times)
{
Expand All @@ -91,7 +94,7 @@ public function __call($method, $arguments)
}

/**
* @param callable $callable
* @param callable $callable
* @return PromiseInterface[]
*/
public function handle(callable $callable): array
Expand Down
9 changes: 5 additions & 4 deletions src/Concerns/InteractsWithAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ trait InteractsWithAuthentication
* @var string|null
*/
protected $guard;

/**
* @var string|null
*/
Expand All @@ -21,8 +22,8 @@ trait InteractsWithAuthentication
/**
* Set the currently logged in user for the application.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @param string|null $guard
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @param string|null $guard
* @return $this
*/
public function actingAs(UserContract $user, $guard = null)
Expand All @@ -33,8 +34,8 @@ public function actingAs(UserContract $user, $guard = null)
/**
* Set the currently logged in user for the application.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @param string|null $guard
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @param string|null $guard
* @return $this
*/
public function be(UserContract $user, $guard = null)
Expand Down
124 changes: 62 additions & 62 deletions src/Concerns/MakesHttpRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ trait MakesHttpRequests
/**
* Define additional headers to be sent with the request.
*
* @param array $headers
* @param array $headers
* @return $this
*/
public function withHeaders(array $headers): self
Expand All @@ -81,8 +81,8 @@ public function withHeaders(array $headers): self
/**
* Add a header to be sent with the request.
*
* @param string $name
* @param string $value
* @param string $name
* @param string $value
* @return $this
*/
public function withHeader(string $name, string $value): self
Expand All @@ -95,8 +95,8 @@ public function withHeader(string $name, string $value): self
/**
* Add an authorization token for the request.
*
* @param string $token
* @param string $type
* @param string $token
* @param string $type
* @return $this
*/
public function withToken(string $token, string $type = 'Bearer'): self
Expand All @@ -119,7 +119,7 @@ public function flushHeaders(): self
/**
* Define a set of server variables to be sent with the requests.
*
* @param array $server
* @param array $server
* @return $this
*/
public function withServerVariables(array $server): self
Expand All @@ -132,7 +132,7 @@ public function withServerVariables(array $server): self
/**
* Disable middleware for the test.
*
* @param string|array|null $middleware
* @param string|array|null $middleware
* @return $this
*/
public function withoutMiddleware($middleware = null): self
Expand All @@ -145,7 +145,7 @@ public function withoutMiddleware($middleware = null): self
/**
* Enable the given middleware for the test.
*
* @param string|array|null $middleware
* @param string|array|null $middleware
* @return $this
*/
public function withMiddleware($middleware = null): self
Expand All @@ -158,7 +158,7 @@ public function withMiddleware($middleware = null): self
/**
* Define additional cookies to be sent with the request.
*
* @param array $cookies
* @param array $cookies
* @return $this
*/
public function withCookies(array $cookies): self
Expand All @@ -171,8 +171,8 @@ public function withCookies(array $cookies): self
/**
* Add a cookie to be sent with the request.
*
* @param string $name
* @param string $value
* @param string $name
* @param string $value
* @return $this
*/
public function withCookie(string $name, string $value): self
Expand All @@ -185,7 +185,7 @@ public function withCookie(string $name, string $value): self
/**
* Define additional cookies will not be encrypted before sending with the request.
*
* @param array $cookies
* @param array $cookies
* @return $this
*/
public function withUnencryptedCookies(array $cookies): self
Expand All @@ -198,8 +198,8 @@ public function withUnencryptedCookies(array $cookies): self
/**
* Add a cookie will not be encrypted before sending with the request.
*
* @param string $name
* @param string $value
* @param string $name
* @param string $value
* @return $this
*/
public function withUnencryptedCookie(string $name, string $value): self
Expand Down Expand Up @@ -248,7 +248,7 @@ public function disableCookieEncryption(): self
/**
* Set the referer header and previous URL session value in order to simulate a previous request.
*
* @param string $url
* @param string $url
* @return $this
*/
public function from(string $url): self
Expand All @@ -259,8 +259,8 @@ public function from(string $url): self
/**
* Visit the given URI with a GET request.
*
* @param string $uri
* @param array $headers
* @param string $uri
* @param array $headers
* @return PromiseInterface
*/
public function get(string $uri, array $headers = []): PromiseInterface
Expand All @@ -274,8 +274,8 @@ public function get(string $uri, array $headers = []): PromiseInterface
/**
* Visit the given URI with a GET request, expecting a JSON response.
*
* @param string $uri
* @param array $headers
* @param string $uri
* @param array $headers
* @return PromiseInterface
*/
public function getJson(string $uri, array $headers = []): PromiseInterface
Expand All @@ -286,9 +286,9 @@ public function getJson(string $uri, array $headers = []): PromiseInterface
/**
* Visit the given URI with a POST request.
*
* @param string $uri
* @param array $data
* @param array $headers
* @param string $uri
* @param array $data
* @param array $headers
* @return PromiseInterface
*/
public function post(string $uri, array $data = [], array $headers = []): PromiseInterface
Expand All @@ -302,9 +302,9 @@ public function post(string $uri, array $data = [], array $headers = []): Promis
/**
* Visit the given URI with a POST request, expecting a JSON response.
*
* @param string $uri
* @param array $data
* @param array $headers
* @param string $uri
* @param array $data
* @param array $headers
* @return PromiseInterface
*/
public function postJson(string $uri, array $data = [], array $headers = []): PromiseInterface
Expand All @@ -315,9 +315,9 @@ public function postJson(string $uri, array $data = [], array $headers = []): Pr
/**
* Visit the given URI with a PUT request.
*
* @param string $uri
* @param array $data
* @param array $headers
* @param string $uri
* @param array $data
* @param array $headers
* @return PromiseInterface
*/
public function put(string $uri, array $data = [], array $headers = []): PromiseInterface
Expand All @@ -331,9 +331,9 @@ public function put(string $uri, array $data = [], array $headers = []): Promise
/**
* Visit the given URI with a PUT request, expecting a JSON response.
*
* @param string $uri
* @param array $data
* @param array $headers
* @param string $uri
* @param array $data
* @param array $headers
* @return PromiseInterface
*/
public function putJson(string $uri, array $data = [], array $headers = []): PromiseInterface
Expand All @@ -344,9 +344,9 @@ public function putJson(string $uri, array $data = [], array $headers = []): Pro
/**
* Visit the given URI with a PATCH request.
*
* @param string $uri
* @param array $data
* @param array $headers
* @param string $uri
* @param array $data
* @param array $headers
* @return PromiseInterface
*/
public function patch(string $uri, array $data = [], array $headers = []): PromiseInterface
Expand All @@ -360,9 +360,9 @@ public function patch(string $uri, array $data = [], array $headers = []): Promi
/**
* Visit the given URI with a PATCH request, expecting a JSON response.
*
* @param string $uri
* @param array $data
* @param array $headers
* @param string $uri
* @param array $data
* @param array $headers
* @return PromiseInterface
*/
public function patchJson(string $uri, array $data = [], array $headers = []): PromiseInterface
Expand All @@ -373,9 +373,9 @@ public function patchJson(string $uri, array $data = [], array $headers = []): P
/**
* Visit the given URI with a DELETE request.
*
* @param string $uri
* @param array $data
* @param array $headers
* @param string $uri
* @param array $data
* @param array $headers
* @return PromiseInterface
*/
public function delete(string $uri, array $data = [], array $headers = []): PromiseInterface
Expand All @@ -389,9 +389,9 @@ public function delete(string $uri, array $data = [], array $headers = []): Prom
/**
* Visit the given URI with a DELETE request, expecting a JSON response.
*
* @param string $uri
* @param array $data
* @param array $headers
* @param string $uri
* @param array $data
* @param array $headers
* @return PromiseInterface
*/
public function deleteJson(string $uri, array $data = [], array $headers = []): PromiseInterface
Expand All @@ -402,9 +402,9 @@ public function deleteJson(string $uri, array $data = [], array $headers = []):
/**
* Visit the given URI with an OPTIONS request.
*
* @param string $uri
* @param array $data
* @param array $headers
* @param string $uri
* @param array $data
* @param array $headers
* @return PromiseInterface
*/
public function options(string $uri, array $data = [], array $headers = []): PromiseInterface
Expand All @@ -418,9 +418,9 @@ public function options(string $uri, array $data = [], array $headers = []): Pro
/**
* Visit the given URI with an OPTIONS request, expecting a JSON response.
*
* @param string $uri
* @param array $data
* @param array $headers
* @param string $uri
* @param array $data
* @param array $headers
* @return PromiseInterface
*/
public function optionsJson(string $uri, array $data = [], array $headers = []): PromiseInterface
Expand All @@ -431,10 +431,10 @@ public function optionsJson(string $uri, array $data = [], array $headers = []):
/**
* Call the given URI with a JSON request.
*
* @param string $method
* @param string $uri
* @param array $data
* @param array $headers
* @param string $method
* @param string $uri
* @param array $data
* @param array $headers
* @return PromiseInterface
*/
public function json(string $method, string $uri, array $data = [], array $headers = []): PromiseInterface
Expand All @@ -461,19 +461,19 @@ public function json(string $method, string $uri, array $data = [], array $heade
/**
* Call the given URI and return the Response.
*
* @param string $method
* @param string $uri
* @param array $parameters
* @param array $cookies
* @param array $files
* @param array $server
* @param null $content
* @param string $method
* @param string $uri
* @param array $parameters
* @param array $cookies
* @param array $files
* @param array $server
* @param null $content
* @return PromiseInterface
*/
abstract public function call(string $method, string $uri, array $parameters = [], array $cookies = [], array $files = [], array $server = [], $content = null): PromiseInterface;

/**
* @param array $headers
* @param array $headers
* @return array
*/
private function transformHeadersToServerVars(array $headers): array
Expand All @@ -490,7 +490,7 @@ private function transformHeadersToServerVars(array $headers): array
}

/**
* @param string $name
* @param string $name
* @return string
*/
private function formatServerHeaderKey(string $name): string
Expand Down
Loading

0 comments on commit 1113f31

Please sign in to comment.