mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-22 21:19:46 +05:30
Merge pull request #1008 from iansltx/typehints-and-exts
Typehint ServerRequestInterface on OAuthServerException, explicitly require ext-json
This commit is contained in:
commit
93d4b947d8
@ -35,7 +35,7 @@ The following versions of PHP are supported:
|
|||||||
* PHP 7.1
|
* PHP 7.1
|
||||||
* PHP 7.2
|
* PHP 7.2
|
||||||
|
|
||||||
The `openssl` extension is also required.
|
The `openssl` and `json` extensions are also required.
|
||||||
|
|
||||||
All HTTP messages passed to the server should be [PSR-7 compliant](https://www.php-fig.org/psr/psr-7/). This ensures interoperability with other packages and frameworks.
|
All HTTP messages passed to the server should be [PSR-7 compliant](https://www.php-fig.org/psr/psr-7/). This ensures interoperability with other packages and frameworks.
|
||||||
|
|
||||||
|
@ -9,7 +9,8 @@
|
|||||||
"league/event": "^2.1",
|
"league/event": "^2.1",
|
||||||
"lcobucci/jwt": "^3.2.2",
|
"lcobucci/jwt": "^3.2.2",
|
||||||
"psr/http-message": "^1.0.1",
|
"psr/http-message": "^1.0.1",
|
||||||
"defuse/php-encryption": "^2.1"
|
"defuse/php-encryption": "^2.1",
|
||||||
|
"ext-json": "*"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^6.3 || ^7.0",
|
"phpunit/phpunit": "^6.3 || ^7.0",
|
||||||
|
@ -95,7 +95,7 @@ class OAuthServerException extends \Exception
|
|||||||
*
|
*
|
||||||
* @param ServerRequestInterface $serverRequest
|
* @param ServerRequestInterface $serverRequest
|
||||||
*/
|
*/
|
||||||
public function setServerRequest($serverRequest)
|
public function setServerRequest(ServerRequestInterface $serverRequest)
|
||||||
{
|
{
|
||||||
$this->serverRequest = $serverRequest;
|
$this->serverRequest = $serverRequest;
|
||||||
}
|
}
|
||||||
@ -137,7 +137,7 @@ class OAuthServerException extends \Exception
|
|||||||
*
|
*
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
public static function invalidClient($serverRequest)
|
public static function invalidClient(ServerRequestInterface $serverRequest)
|
||||||
{
|
{
|
||||||
$exception = new static('Client authentication failed', 4, 'invalid_client', 401);
|
$exception = new static('Client authentication failed', 4, 'invalid_client', 401);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user