@@ -57,8 +57,7 @@ |
||
57 | 57 | * @class SchedulerServiceProvider |
58 | 58 | * @package Platine\Framework\Service\Provider |
59 | 59 | */ |
60 | -class SchedulerServiceProvider extends ServiceProvider |
|
61 | -{ |
|
60 | +class SchedulerServiceProvider extends ServiceProvider { |
|
62 | 61 | /** |
63 | 62 | * {@inheritdoc} |
64 | 63 | */ |
@@ -57,8 +57,7 @@ |
||
57 | 57 | * @class EventServiceProvider |
58 | 58 | * @package Platine\Framework\Service\Provider |
59 | 59 | */ |
60 | -class EventServiceProvider extends ServiceProvider |
|
61 | -{ |
|
60 | +class EventServiceProvider extends ServiceProvider { |
|
62 | 61 | /** |
63 | 62 | * {@inheritdoc} |
64 | 63 | */ |
@@ -70,7 +70,7 @@ |
||
70 | 70 | */ |
71 | 71 | public function register(): void |
72 | 72 | { |
73 | - $this->app->bind(Configuration::class, function (ContainerInterface $app) { |
|
73 | + $this->app->bind(Configuration::class, function(ContainerInterface $app) { |
|
74 | 74 | return new Configuration($app->get(Config::class)->get('cache', [])); |
75 | 75 | }); |
76 | 76 | $this->app->bind(AdapterInterface::class, LocalAdapter::class); |
@@ -63,14 +63,13 @@ |
||
63 | 63 | * @class CacheServiceProvider |
64 | 64 | * @package Platine\Framework\Service\Provider |
65 | 65 | */ |
66 | -class CacheServiceProvider extends ServiceProvider |
|
67 | -{ |
|
66 | +class CacheServiceProvider extends ServiceProvider { |
|
68 | 67 | /** |
69 | 68 | * {@inheritdoc} |
70 | 69 | */ |
71 | 70 | public function register(): void |
72 | 71 | { |
73 | - $this->app->bind(Configuration::class, function (ContainerInterface $app) { |
|
72 | + $this->app->bind(Configuration::class, function (ContainerInterface $app) { |
|
74 | 73 | return new Configuration($app->get(Config::class)->get('cache', [])); |
75 | 74 | }); |
76 | 75 | $this->app->bind(AdapterInterface::class, LocalAdapter::class); |
@@ -70,8 +70,7 @@ |
||
70 | 70 | * @class CommandServiceProvider |
71 | 71 | * @package Platine\Framework\Service\Provider |
72 | 72 | */ |
73 | -class CommandServiceProvider extends ServiceProvider |
|
74 | -{ |
|
73 | +class CommandServiceProvider extends ServiceProvider { |
|
75 | 74 | /** |
76 | 75 | * {@inheritdoc} |
77 | 76 | */ |
@@ -66,7 +66,7 @@ |
||
66 | 66 | */ |
67 | 67 | public function register(): void |
68 | 68 | { |
69 | - $this->app->bind(LoggerInterface::class, function (ContainerInterface $app) { |
|
69 | + $this->app->bind(LoggerInterface::class, function(ContainerInterface $app) { |
|
70 | 70 | $cfg = new LoggerConfiguration( |
71 | 71 | $app->get(Config::class)->get('logging', []) |
72 | 72 | ); |
@@ -59,14 +59,13 @@ |
||
59 | 59 | * @class LoggerServiceProvider |
60 | 60 | * @package Platine\Framework\Service\Provider |
61 | 61 | */ |
62 | -class LoggerServiceProvider extends ServiceProvider |
|
63 | -{ |
|
62 | +class LoggerServiceProvider extends ServiceProvider { |
|
64 | 63 | /** |
65 | 64 | * {@inheritdoc} |
66 | 65 | */ |
67 | 66 | public function register(): void |
68 | 67 | { |
69 | - $this->app->bind(LoggerInterface::class, function (ContainerInterface $app) { |
|
68 | + $this->app->bind(LoggerInterface::class, function (ContainerInterface $app) { |
|
70 | 69 | $cfg = new LoggerConfiguration( |
71 | 70 | $app->get(Config::class)->get('logging', []) |
72 | 71 | ); |
@@ -65,7 +65,7 @@ |
||
65 | 65 | */ |
66 | 66 | public function register(): void |
67 | 67 | { |
68 | - $this->app->bind(Dompdf::class, function (ContainerInterface $app) { |
|
68 | + $this->app->bind(Dompdf::class, function(ContainerInterface $app) { |
|
69 | 69 | $defaultOptions = array( |
70 | 70 | 'isRemoteEnabled' => true |
71 | 71 | ); |
@@ -58,14 +58,13 @@ |
||
58 | 58 | * @class PDFServiceProvider |
59 | 59 | * @package Platine\Framework\Service\Provider |
60 | 60 | */ |
61 | -class PDFServiceProvider extends ServiceProvider |
|
62 | -{ |
|
61 | +class PDFServiceProvider extends ServiceProvider { |
|
63 | 62 | /** |
64 | 63 | * {@inheritdoc} |
65 | 64 | */ |
66 | 65 | public function register(): void |
67 | 66 | { |
68 | - $this->app->bind(Dompdf::class, function (ContainerInterface $app) { |
|
67 | + $this->app->bind(Dompdf::class, function (ContainerInterface $app) { |
|
69 | 68 | $defaultOptions = array( |
70 | 69 | 'isRemoteEnabled' => true |
71 | 70 | ); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $this->app->bind(UserAuthenticationInterface::class, UserAuthentication::class); |
106 | 106 | |
107 | 107 | // Configuration |
108 | - $this->app->bind(Configuration::class, function (ContainerInterface $app) { |
|
108 | + $this->app->bind(Configuration::class, function(ContainerInterface $app) { |
|
109 | 109 | return new Configuration($app->get(Config::class)->get('oauth2', [])); |
110 | 110 | }); |
111 | 111 | |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | */ |
165 | 165 | public function addRoutes(Router $router): void |
166 | 166 | { |
167 | - $router->group('/oauth2', function (Router $router) { |
|
167 | + $router->group('/oauth2', function(Router $router) { |
|
168 | 168 | $router->post('/token', AccessTokenRequestHandler::class, 'oauth2_access_token'); |
169 | 169 | $router->add('/authorize', AuthorizationRequestHandler::class, ['GET', 'POST'], 'oauth2_authorization_code'); |
170 | 170 | $router->post('/revocation', TokenRevocationRequestHandler::class, 'oauth2_revoke_access_token'); |
@@ -93,8 +93,7 @@ discard block |
||
93 | 93 | * @class OAuth2ServiceProvider |
94 | 94 | * @package Platine\App\Provider |
95 | 95 | */ |
96 | -class OAuth2ServiceProvider extends ServiceProvider |
|
97 | -{ |
|
96 | +class OAuth2ServiceProvider extends ServiceProvider { |
|
98 | 97 | /** |
99 | 98 | * {@inheritdoc} |
100 | 99 | */ |
@@ -105,7 +104,7 @@ discard block |
||
105 | 104 | $this->app->bind(UserAuthenticationInterface::class, UserAuthentication::class); |
106 | 105 | |
107 | 106 | // Configuration |
108 | - $this->app->bind(Configuration::class, function (ContainerInterface $app) { |
|
107 | + $this->app->bind(Configuration::class, function (ContainerInterface $app) { |
|
109 | 108 | return new Configuration($app->get(Config::class)->get('oauth2', [])); |
110 | 109 | }); |
111 | 110 | |
@@ -134,10 +133,10 @@ discard block |
||
134 | 133 | $cfg = $this->app->get(Configuration::class); |
135 | 134 | $grants = $cfg->getGrants(); |
136 | 135 | $serverGrants = []; |
137 | - foreach ($grants as $grant) { |
|
138 | - if ($this->app->has($grant)) { |
|
136 | + foreach ($grants as $grant) { |
|
137 | + if ($this->app->has($grant)) { |
|
139 | 138 | $serverGrants[] = $this->app->get($grant); |
140 | - } else { |
|
139 | + } else { |
|
141 | 140 | $serverGrants[] = new $grant(); |
142 | 141 | } |
143 | 142 | } |
@@ -164,7 +163,7 @@ discard block |
||
164 | 163 | */ |
165 | 164 | public function addRoutes(Router $router): void |
166 | 165 | { |
167 | - $router->group('/oauth2', function (Router $router) { |
|
166 | + $router->group('/oauth2', function (Router $router) { |
|
168 | 167 | $router->post('/token', AccessTokenRequestHandler::class, 'oauth2_access_token'); |
169 | 168 | $router->add('/authorize', AuthorizationRequestHandler::class, ['GET', 'POST'], 'oauth2_authorization_code'); |
170 | 169 | $router->post('/revocation', TokenRevocationRequestHandler::class, 'oauth2_revoke_access_token'); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function register(): void |
71 | 71 | { |
72 | - $this->app->bind(Configuration::class, function (ContainerInterface $app) { |
|
72 | + $this->app->bind(Configuration::class, function(ContainerInterface $app) { |
|
73 | 73 | /** @template T @var Config<T> $config */ |
74 | 74 | $config = $app->get(Config::class); |
75 | 75 | $driver = $config->get('database.default', 'default'); |
@@ -77,11 +77,11 @@ discard block |
||
77 | 77 | return new Configuration($config->get('database.connections.' . $driver, [])); |
78 | 78 | }); |
79 | 79 | |
80 | - $this->app->share(Pool::class, function (ContainerInterface $app) { |
|
80 | + $this->app->share(Pool::class, function(ContainerInterface $app) { |
|
81 | 81 | return new Pool($app->get(Config::class)->get('database', [])); |
82 | 82 | }); |
83 | 83 | |
84 | - $this->app->share(Connection::class, function (ContainerInterface $app) { |
|
84 | + $this->app->share(Connection::class, function(ContainerInterface $app) { |
|
85 | 85 | return new Connection( |
86 | 86 | $app->get(Configuration::class), |
87 | 87 | $app->get(LoggerInterface::class) |
@@ -62,14 +62,13 @@ discard block |
||
62 | 62 | * @class DatabaseServiceProvider |
63 | 63 | * @package Platine\Framework\Service\Provider |
64 | 64 | */ |
65 | -class DatabaseServiceProvider extends ServiceProvider |
|
66 | -{ |
|
65 | +class DatabaseServiceProvider extends ServiceProvider { |
|
67 | 66 | /** |
68 | 67 | * {@inheritdoc} |
69 | 68 | */ |
70 | 69 | public function register(): void |
71 | 70 | { |
72 | - $this->app->bind(Configuration::class, function (ContainerInterface $app) { |
|
71 | + $this->app->bind(Configuration::class, function (ContainerInterface $app) { |
|
73 | 72 | /** @template T @var Config<T> $config */ |
74 | 73 | $config = $app->get(Config::class); |
75 | 74 | $driver = $config->get('database.default', 'default'); |
@@ -77,11 +76,11 @@ discard block |
||
77 | 76 | return new Configuration($config->get('database.connections.' . $driver, [])); |
78 | 77 | }); |
79 | 78 | |
80 | - $this->app->share(Pool::class, function (ContainerInterface $app) { |
|
79 | + $this->app->share(Pool::class, function (ContainerInterface $app) { |
|
81 | 80 | return new Pool($app->get(Config::class)->get('database', [])); |
82 | 81 | }); |
83 | 82 | |
84 | - $this->app->share(Connection::class, function (ContainerInterface $app) { |
|
83 | + $this->app->share(Connection::class, function (ContainerInterface $app) { |
|
85 | 84 | return new Connection( |
86 | 85 | $app->get(Configuration::class), |
87 | 86 | $app->get(LoggerInterface::class) |
@@ -66,7 +66,7 @@ |
||
66 | 66 | public function register(): void |
67 | 67 | { |
68 | 68 | $this->app->bind(AdapterInterface::class, OpenSSL::class); |
69 | - $this->app->bind(Encryption::class, function (ContainerInterface $app) { |
|
69 | + $this->app->bind(Encryption::class, function(ContainerInterface $app) { |
|
70 | 70 | $e = new Encryption($app->get(AdapterInterface::class)); |
71 | 71 | $e->setSecret($app->get(Config::class)->get('security.encryption.key', '')); |
72 | 72 |
@@ -58,15 +58,14 @@ |
||
58 | 58 | * @class EncryptionServiceProvider |
59 | 59 | * @package Platine\Framework\Service\Provider |
60 | 60 | */ |
61 | -class EncryptionServiceProvider extends ServiceProvider |
|
62 | -{ |
|
61 | +class EncryptionServiceProvider extends ServiceProvider { |
|
63 | 62 | /** |
64 | 63 | * {@inheritdoc} |
65 | 64 | */ |
66 | 65 | public function register(): void |
67 | 66 | { |
68 | 67 | $this->app->bind(AdapterInterface::class, OpenSSL::class); |
69 | - $this->app->bind(Encryption::class, function (ContainerInterface $app) { |
|
68 | + $this->app->bind(Encryption::class, function (ContainerInterface $app) { |
|
70 | 69 | $e = new Encryption($app->get(AdapterInterface::class)); |
71 | 70 | $e->setSecret($app->get(Config::class)->get('security.encryption.key', '')); |
72 | 71 |