bytic /
hello
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace ByTIC\Hello\Oauth\ServiceProvider\Traits; |
||||
| 4 | |||||
| 5 | use ByTIC\Hello\Utility\ModelsHelper; |
||||
| 6 | use League\OAuth2\Server\AuthorizationServer; |
||||
| 7 | |||||
| 8 | /** |
||||
| 9 | * Trait AuthorizationServerTrait |
||||
| 10 | * @package ByTIC\Hello\Oauth\ServiceProvider\Traits |
||||
| 11 | */ |
||||
| 12 | trait AuthorizationServerTrait |
||||
| 13 | { |
||||
| 14 | 1 | use GrantsTrait; |
|||
| 15 | 1 | use CryptKeysTrait; |
|||
| 16 | |||||
| 17 | 2 | public function registerAuthorizationServer() |
|||
| 18 | { |
||||
| 19 | 2 | $this->registerCryptKeys(); |
|||
| 20 | |||||
| 21 | 2 | $this->getContainer()->alias('hello.server', AuthorizationServer::class); |
|||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 22 | |||||
| 23 | 2 | $this->getContainer()->share('hello.server', function () { |
|||
| 24 | 2 | $server = $this->createAuthorizationServer(); |
|||
| 25 | 2 | $this->registerGrants($server); |
|||
| 26 | 2 | return $server; |
|||
| 27 | 2 | }); |
|||
| 28 | 2 | } |
|||
| 29 | |||||
| 30 | /** |
||||
| 31 | * @return AuthorizationServer |
||||
| 32 | */ |
||||
| 33 | protected function createAuthorizationServer() |
||||
| 34 | { |
||||
| 35 | $server = new AuthorizationServer( |
||||
| 36 | ModelsHelper::clients(), |
||||
|
0 ignored issues
–
show
ByTIC\Hello\Utility\ModelsHelper::clients() of type Nip\Records\AbstractModels\RecordManager is incompatible with the type League\OAuth2\Server\Rep...ientRepositoryInterface expected by parameter $clientRepository of League\OAuth2\Server\Aut...onServer::__construct().
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 37 | ModelsHelper::accessTokens(), |
||||
|
0 ignored issues
–
show
ByTIC\Hello\Utility\ModelsHelper::accessTokens() of type Nip\Records\AbstractModels\RecordManager is incompatible with the type League\OAuth2\Server\Rep...okenRepositoryInterface expected by parameter $accessTokenRepository of League\OAuth2\Server\Aut...onServer::__construct().
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 38 | ModelsHelper::scopes(), |
||||
|
0 ignored issues
–
show
ByTIC\Hello\Utility\ModelsHelper::scopes() of type Nip\Records\AbstractModels\RecordManager is incompatible with the type League\OAuth2\Server\Rep...copeRepositoryInterface expected by parameter $scopeRepository of League\OAuth2\Server\Aut...onServer::__construct().
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 39 | $this->getContainer()->get('hello.keys.private'), |
||||
| 40 | $this->getContainer()->get('hello.keys.public') |
||||
| 41 | ); |
||||
| 42 | |||||
| 43 | return $server; |
||||
| 44 | } |
||||
| 45 | } |
||||
| 46 |