|
24 | 24 | use OCP\Util; |
25 | 25 |
|
26 | 26 | class Application extends App implements IBootstrap { |
27 | | - public const APP_ID = 'solid'; |
| 27 | + public const APP_ID = 'solid'; |
28 | 28 |
|
29 | | - /** |
30 | | - * @param array $urlParams |
31 | | - */ |
32 | | - public function __construct(array $urlParams = []) { |
33 | | - parent::__construct(self::APP_ID, $urlParams); |
| 29 | + /** |
| 30 | + * @param array $urlParams |
| 31 | + */ |
| 32 | + public function __construct(array $urlParams = []) { |
| 33 | + parent::__construct(self::APP_ID, $urlParams); |
34 | 34 |
|
35 | | - $container = $this->getContainer(); |
| 35 | + $container = $this->getContainer(); |
36 | 36 |
|
37 | | - $container->registerService(SolidCorsMiddleware::class, function($c): SolidCorsMiddleware{ |
38 | | - return new SolidCorsMiddleware( |
39 | | - $c->get(IRequest::class) |
40 | | - ); |
41 | | - }); |
| 37 | + $container->registerService(SolidCorsMiddleware::class, function($c): SolidCorsMiddleware { |
| 38 | + return new SolidCorsMiddleware( |
| 39 | + $c->get(IRequest::class) |
| 40 | + ); |
| 41 | + }); |
42 | 42 |
|
43 | | - // executed in the order that it is registered |
44 | | - $container->registerMiddleware(SolidCorsMiddleware::class); |
45 | | - } |
| 43 | + // executed in the order that it is registered |
| 44 | + $container->registerMiddleware(SolidCorsMiddleware::class); |
| 45 | + } |
46 | 46 |
|
47 | | - public function register(IRegistrationContext $context): void { |
48 | | - $context->registerWellKnownHandler(\OCA\Solid\WellKnown\OpenIdConfigurationHandler::class); |
| 47 | + public function register(IRegistrationContext $context): void { |
| 48 | + $context->registerWellKnownHandler(\OCA\Solid\WellKnown\OpenIdConfigurationHandler::class); |
49 | 49 |
|
50 | | - /** |
51 | | - * Core class wrappers |
52 | | - */ |
| 50 | + /** |
| 51 | + * Core class wrappers |
| 52 | + */ |
53 | 53 |
|
54 | | - $context->registerService('UserService', function($c) { |
55 | | - return new \OCA\Solid\Service\UserService( |
56 | | - $c->query('UserSession') |
57 | | - ); |
58 | | - }); |
59 | | - $context->registerService('UserSession', function($c) { |
60 | | - return $c->query('ServerContainer')->getUserSession(); |
61 | | - }); |
| 54 | + $context->registerService('UserService', function($c) { |
| 55 | + return new \OCA\Solid\Service\UserService( |
| 56 | + $c->query('UserSession') |
| 57 | + ); |
| 58 | + }); |
| 59 | + $context->registerService('UserSession', function($c) { |
| 60 | + return $c->query('ServerContainer')->getUserSession(); |
| 61 | + }); |
62 | 62 |
|
63 | | - // currently logged in user, userId can be gotten by calling the |
64 | | - // getUID() method on it |
65 | | - $context->registerService('User', function($c) { |
66 | | - return $c->query('UserSession')->getUser(); |
67 | | - }); |
68 | | - } |
| 63 | + // currently logged in user, userId can be gotten by calling the |
| 64 | + // getUID() method on it |
| 65 | + $context->registerService('User', function($c) { |
| 66 | + return $c->query('UserSession')->getUser(); |
| 67 | + }); |
| 68 | + } |
69 | 69 |
|
70 | | - public function boot(IBootContext $context): void { |
71 | | - } |
| 70 | + public function boot(IBootContext $context): void { |
| 71 | + } |
72 | 72 | } |
0 commit comments