1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Created by PhpStorm. |
4
|
|
|
* User: Alexandre |
5
|
|
|
* Date: 23/01/2018 |
6
|
|
|
* Time: 00:10 |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
namespace OAuth2\OpenID; |
10
|
|
|
|
11
|
|
|
|
12
|
|
|
use OAuth2\ClientAuthentication\Guard; |
13
|
|
|
use OAuth2\OpenID\Endpoints\AuthorizationEndpoint; |
14
|
|
|
use OAuth2\Providers\ResourceOwnerProviderInterface; |
15
|
|
|
use OAuth2\Repositories\ClientAuthenticatorRepository; |
16
|
|
|
use OAuth2\Repositories\ConfigurationRepository; |
17
|
|
|
use OAuth2\Repositories\GrantTypeRepository; |
18
|
|
|
use OAuth2\Repositories\ResponseTypeRepository; |
19
|
|
|
use OAuth2\Repositories\StorageRepository; |
20
|
|
|
use OAuth2\ScopePolicy\Manager; |
21
|
|
|
|
22
|
|
|
class Server extends \OAuth2\Server |
23
|
|
|
{ |
24
|
|
|
/** |
25
|
|
|
* Server constructor. |
26
|
|
|
* @param ResourceOwnerProviderInterface $resourceOwnerProvider |
27
|
|
|
* @param null|StorageRepository $storageRepository |
28
|
|
|
* @param null|ConfigurationRepository $configurationRepository |
29
|
|
|
* @param null|ResponseTypeRepository $responseTypeRepository |
30
|
|
|
* @param null|GrantTypeRepository $grantTypeRepository |
31
|
|
|
* @param null|ClientAuthenticatorRepository $clientAuthenticatorRepository |
32
|
|
|
* @param null|Guard $guard |
33
|
|
|
* @param null|Manager $scopePolicyManager |
34
|
|
|
* @throws \Exception |
35
|
|
|
*/ |
36
|
|
|
public function __construct(ResourceOwnerProviderInterface $resourceOwnerProvider, |
37
|
|
|
?StorageRepository $storageRepository, |
38
|
|
|
?ConfigurationRepository $configurationRepository = null, |
39
|
|
|
?ResponseTypeRepository $responseTypeRepository = null, |
40
|
|
|
?GrantTypeRepository $grantTypeRepository = null, |
41
|
|
|
?ClientAuthenticatorRepository $clientAuthenticatorRepository = null, |
42
|
|
|
?Guard $guard = null, |
43
|
|
|
?Manager $scopePolicyManager = null) |
44
|
|
|
{ |
45
|
|
|
parent::__construct($resourceOwnerProvider, $storageRepository, $configurationRepository, |
|
|
|
|
46
|
|
|
$responseTypeRepository, $grantTypeRepository, $clientAuthenticatorRepository, $guard, $scopePolicyManager); |
47
|
|
|
|
48
|
|
|
$this->authorizationEndpoint = new AuthorizationEndpoint($this); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @return \OAuth2\OpenID\Endpoints\AuthorizationEndpoint |
53
|
|
|
*/ |
54
|
|
|
public function getAuthorizationEndpoint(): \OAuth2\Endpoints\AuthorizationEndpoint |
55
|
|
|
{ |
56
|
|
|
return $this->authorizationEndpoint; |
57
|
|
|
} |
58
|
|
|
} |
It seems like you allow that null is being passed for a parameter, however the function which is called does not seem to accept null.
We recommend to add an additional type check (or disallow null for the parameter):