1 | <?php namespace Nord\Lumen\OAuth2; |
||
21 | class OAuth2ServiceProvider extends ServiceProvider |
||
22 | { |
||
23 | const CONFIG_KEY = 'oauth2'; |
||
24 | |||
25 | /** |
||
26 | * @inheritdoc |
||
27 | */ |
||
28 | public function register() |
||
29 | { |
||
30 | $this->app->configure(self::CONFIG_KEY); |
||
|
|||
31 | |||
32 | $this->registerBindings($this->app, $this->app['config']); |
||
33 | $this->registerFacades(); |
||
34 | } |
||
35 | |||
36 | |||
37 | /** |
||
38 | * Registers container bindings. |
||
39 | * |
||
40 | * @param Container $container |
||
41 | * @param ConfigRepository $config |
||
42 | */ |
||
43 | protected function registerBindings(Container $container, ConfigRepository $config) |
||
44 | { |
||
45 | $container->bind(OAuth2Service::class, function ($container) use ($config) { |
||
46 | return $this->createService($container, $config[self::CONFIG_KEY]); |
||
47 | }); |
||
48 | |||
49 | $container->alias(OAuth2Service::class, OAuth2ServiceContract::class); |
||
50 | } |
||
51 | |||
52 | |||
53 | /** |
||
54 | * Registers facades. |
||
55 | */ |
||
56 | protected function registerFacades() |
||
62 | |||
63 | |||
64 | /** |
||
65 | * Creates the service instance. |
||
66 | * |
||
67 | * @param Container $container |
||
68 | * @param array $config |
||
69 | * |
||
70 | * @return OAuth2Service |
||
71 | */ |
||
72 | protected function createService(Container $container, array $config) |
||
79 | |||
80 | |||
81 | /** |
||
82 | * Creates the authorization instance. |
||
83 | * |
||
84 | * @param Container $container |
||
85 | * @param array $config |
||
86 | * |
||
87 | * @return AuthorizationServer |
||
88 | * @throws Exception |
||
89 | */ |
||
90 | protected function createAuthorizationServer(Container $container, array $config) |
||
107 | |||
108 | |||
109 | /** |
||
110 | * Configures the authorization server instance. |
||
111 | * |
||
112 | * @param AuthorizationServer $authorizationServer |
||
113 | * @param array $config |
||
114 | */ |
||
115 | protected function configureAuthorizationServer(AuthorizationServer $authorizationServer, array $config) |
||
135 | |||
136 | |||
137 | /** |
||
138 | * Configures the grant types for the authorization server instance. |
||
139 | * |
||
140 | * @param AuthorizationServer $authorizationServer |
||
141 | * @param array $config |
||
142 | * |
||
143 | * @throws InvalidArgument |
||
144 | */ |
||
145 | protected function configureGrantTypes(AuthorizationServer $authorizationServer, array $config) |
||
180 | |||
181 | |||
182 | /** |
||
183 | * Creates the resource server. |
||
184 | * |
||
185 | * @param Container $container |
||
186 | * |
||
187 | * @return ResourceServer |
||
188 | */ |
||
189 | protected function createResourceServer(Container $container) |
||
193 | } |
||
194 |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.