@@ -35,7 +35,7 @@ |
||
35 | 35 | */ |
36 | 36 | private function init() |
37 | 37 | { |
38 | - $this->setVerifyCredentialsCallback(function ($username, $password) { |
|
38 | + $this->setVerifyCredentialsCallback(function($username, $password) { |
|
39 | 39 | $user = $this->userProvider->loadUserByUsername($username); |
40 | 40 | |
41 | 41 | if (null === $user) { |
@@ -25,13 +25,13 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function register(Container $app) |
27 | 27 | { |
28 | - $app['oauth.tokens_dir.access_token'] = function () use ($app) { |
|
28 | + $app['oauth.tokens_dir.access_token'] = function() use ($app) { |
|
29 | 29 | $dir = $app['oauth.tokens_dir'].'/access-tokens'; |
30 | 30 | $this->touchDir($dir); |
31 | 31 | return $dir; |
32 | 32 | }; |
33 | 33 | |
34 | - $app['oauth.tokens_dir.refresh_token'] = function () use ($app) { |
|
34 | + $app['oauth.tokens_dir.refresh_token'] = function() use ($app) { |
|
35 | 35 | $dir = $app['oauth.tokens_dir'].'/refresh-tokens'; |
36 | 36 | $this->touchDir($dir); |
37 | 37 | return $dir; |
@@ -40,30 +40,30 @@ discard block |
||
40 | 40 | /** |
41 | 41 | * Storage |
42 | 42 | */ |
43 | - $app['sandstone.oauth.storage.session'] = function () use ($app) { |
|
43 | + $app['sandstone.oauth.storage.session'] = function() use ($app) { |
|
44 | 44 | return new Session($app['oauth.tokens_dir.access_token'], $app['oauth.scope']); |
45 | 45 | }; |
46 | 46 | |
47 | - $app['sandstone.oauth.storage.access_token'] = function () use ($app) { |
|
47 | + $app['sandstone.oauth.storage.access_token'] = function() use ($app) { |
|
48 | 48 | return new AccessToken($app['oauth.tokens_dir.access_token']); |
49 | 49 | }; |
50 | 50 | |
51 | - $app['sandstone.oauth.storage.client'] = function () use ($app) { |
|
51 | + $app['sandstone.oauth.storage.client'] = function() use ($app) { |
|
52 | 52 | return new Client($app['oauth.clients']); |
53 | 53 | }; |
54 | 54 | |
55 | - $app['sandstone.oauth.storage.scope'] = function () { |
|
55 | + $app['sandstone.oauth.storage.scope'] = function() { |
|
56 | 56 | return new Scope(); |
57 | 57 | }; |
58 | 58 | |
59 | - $app['sandstone.oauth.storage.refresh_token'] = function () use ($app) { |
|
59 | + $app['sandstone.oauth.storage.refresh_token'] = function() use ($app) { |
|
60 | 60 | return new RefreshTokenStorage($app['oauth.tokens_dir.refresh_token']); |
61 | 61 | }; |
62 | 62 | |
63 | 63 | /** |
64 | 64 | * Grant |
65 | 65 | */ |
66 | - $app['sandstone.oauth.grant.password'] = function () use ($app) { |
|
66 | + $app['sandstone.oauth.grant.password'] = function() use ($app) { |
|
67 | 67 | $userProvider = $app['oauth.security.user_provider']; |
68 | 68 | |
69 | 69 | if (is_string($userProvider)) { |
@@ -76,14 +76,14 @@ discard block |
||
76 | 76 | ); |
77 | 77 | }; |
78 | 78 | |
79 | - $app['sandstone.oauth.grant.refresh_token'] = function () { |
|
79 | + $app['sandstone.oauth.grant.refresh_token'] = function() { |
|
80 | 80 | return new RefreshTokenGrant(); |
81 | 81 | }; |
82 | 82 | |
83 | 83 | /** |
84 | 84 | * Server |
85 | 85 | */ |
86 | - $app['sandstone.oauth.authorization_server'] = function () use ($app) { |
|
86 | + $app['sandstone.oauth.authorization_server'] = function() use ($app) { |
|
87 | 87 | return new AuthorizationServer( |
88 | 88 | $app['sandstone.oauth.storage.session'], |
89 | 89 | $app['sandstone.oauth.storage.access_token'], |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | ); |
96 | 96 | }; |
97 | 97 | |
98 | - $app['sandstone.oauth.resource_server'] = function () use ($app) { |
|
98 | + $app['sandstone.oauth.resource_server'] = function() use ($app) { |
|
99 | 99 | return new ResourceServer( |
100 | 100 | $app['sandstone.oauth.storage.session'], |
101 | 101 | $app['sandstone.oauth.storage.access_token'], |
@@ -107,10 +107,10 @@ discard block |
||
107 | 107 | /** |
108 | 108 | * Security |
109 | 109 | */ |
110 | - $app['security.authentication_listener.factory.oauth'] = $app->protect(function ($name) use ($app) { |
|
110 | + $app['security.authentication_listener.factory.oauth'] = $app->protect(function($name) use ($app) { |
|
111 | 111 | |
112 | 112 | // define the authentication provider object |
113 | - $app['security.authentication_provider.'.$name.'.oauth'] = function () use ($app) { |
|
113 | + $app['security.authentication_provider.'.$name.'.oauth'] = function() use ($app) { |
|
114 | 114 | return new OAuth2Provider( |
115 | 115 | $app['security.user_provider.'.$app['oauth.firewall_name']], |
116 | 116 | $app['security.user_checker'], |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | }; |
120 | 120 | |
121 | 121 | // define the authentication listener object |
122 | - $app['security.authentication_listener.'.$name.'.oauth'] = function () use ($app) { |
|
122 | + $app['security.authentication_listener.'.$name.'.oauth'] = function() use ($app) { |
|
123 | 123 | return new OAuth2Listener( |
124 | 124 | $app['security.token_storage'], |
125 | 125 | $app['security.authentication_manager'], |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | }; |
129 | 129 | |
130 | 130 | // define the entry point object |
131 | - $app['security.entry_point.'.$name.'.oauth'] = function () { |
|
131 | + $app['security.entry_point.'.$name.'.oauth'] = function() { |
|
132 | 132 | return new NoEntryPoint(); |
133 | 133 | }; |
134 | 134 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | ); |
145 | 145 | }); |
146 | 146 | |
147 | - $app['sandstone.oauth.controller'] = function () use ($app) { |
|
147 | + $app['sandstone.oauth.controller'] = function() use ($app) { |
|
148 | 148 | return new OAuth2Controller($app['sandstone.oauth.authorization_server']); |
149 | 149 | }; |
150 | 150 | } |
@@ -18,11 +18,11 @@ discard block |
||
18 | 18 | $app['sandstone.push.enabled'] = true; |
19 | 19 | } |
20 | 20 | |
21 | - $app['sandstone.push.event_serializer'] = function () use ($app) { |
|
21 | + $app['sandstone.push.event_serializer'] = function() use ($app) { |
|
22 | 22 | return new EventSerializer($app['serializer']); |
23 | 23 | }; |
24 | 24 | |
25 | - $app['sandstone.push'] = function () use ($app) { |
|
25 | + $app['sandstone.push'] = function() use ($app) { |
|
26 | 26 | $pushServerHost = $app['sandstone.push.server']['host']; |
27 | 27 | $pushServerPort = $app['sandstone.push.server']['port']; |
28 | 28 | |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | return $socket; |
34 | 34 | }; |
35 | 35 | |
36 | - $app['sandstone.push.event_forwarder'] = function () use ($app) { |
|
36 | + $app['sandstone.push.event_forwarder'] = function() use ($app) { |
|
37 | 37 | return new EventForwarder( |
38 | 38 | $app['sandstone.push'], |
39 | 39 | $app['dispatcher'], |
@@ -24,7 +24,7 @@ |
||
24 | 24 | */ |
25 | 25 | private function fixAuthorizationHeader() |
26 | 26 | { |
27 | - $this['sandstone.listener.authorization_header_fix'] = function () { |
|
27 | + $this['sandstone.listener.authorization_header_fix'] = function() { |
|
28 | 28 | return new AuthorizationHeaderFixListener(); |
29 | 29 | }; |
30 | 30 |
@@ -14,22 +14,22 @@ |
||
14 | 14 | { |
15 | 15 | public function register(Container $app) |
16 | 16 | { |
17 | - $app['sandstone.websocket.routes'] = function () { |
|
17 | + $app['sandstone.websocket.routes'] = function() { |
|
18 | 18 | return new RouteCollection(); |
19 | 19 | }; |
20 | 20 | |
21 | - $app['sandstone.websocket.topics'] = function () use ($app) { |
|
21 | + $app['sandstone.websocket.topics'] = function() use ($app) { |
|
22 | 22 | return new TopicCollection($app['sandstone.websocket.routes']); |
23 | 23 | }; |
24 | 24 | |
25 | - $app['sandstone.websocket.url_matcher'] = function () use ($app) { |
|
25 | + $app['sandstone.websocket.url_matcher'] = function() use ($app) { |
|
26 | 26 | return new UrlMatcher( |
27 | 27 | $app['sandstone.websocket.routes'], |
28 | 28 | new RequestContext() |
29 | 29 | ); |
30 | 30 | }; |
31 | 31 | |
32 | - $app['sandstone.websocket.router'] = function () use ($app) { |
|
32 | + $app['sandstone.websocket.router'] = function() use ($app) { |
|
33 | 33 | return new TopicRouter($app); |
34 | 34 | }; |
35 | 35 | } |
@@ -73,7 +73,7 @@ |
||
73 | 73 | |
74 | 74 | $pushServer->bind("tcp://$pushBind:$pushPort"); |
75 | 75 | |
76 | - $pushServer->on('message', function ($message) { |
|
76 | + $pushServer->on('message', function($message) { |
|
77 | 77 | $data = $this->sandstoneApplication['sandstone.push.event_serializer']->deserializeEvent($message); |
78 | 78 | |
79 | 79 | echo 'PushServer message event: '.$data['name'].PHP_EOL; |
@@ -25,11 +25,11 @@ |
||
25 | 25 | return parent::create() |
26 | 26 | ->setDefaultSerializationContextFactory(array(self::class, 'createDefaultSerializationContext')) |
27 | 27 | ->addDefaultHandlers() |
28 | - ->configureListeners(function (EventDispatcher $dispatcher) { |
|
28 | + ->configureListeners(function(EventDispatcher $dispatcher) { |
|
29 | 29 | $proxySubscriber = new DoctrineProxySubscriber(false); |
30 | 30 | $dispatcher->addSubscriber($proxySubscriber); |
31 | 31 | }) |
32 | - ->configureHandlers(function (HandlerRegistryInterface $handlerRegistry) { |
|
32 | + ->configureHandlers(function(HandlerRegistryInterface $handlerRegistry) { |
|
33 | 33 | $proxyHandler = new DoctrineProxyHandler(); |
34 | 34 | $handlerRegistry->registerSubscribingHandler($proxyHandler); |
35 | 35 | }) |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | { |
10 | 10 | public function register(Container $app) |
11 | 11 | { |
12 | - $app['serializer.builder'] = function () use ($app) { |
|
12 | + $app['serializer.builder'] = function() use ($app) { |
|
13 | 13 | $builder = SerializerBuilder::create() |
14 | 14 | ->setDebug($app['debug']) |
15 | 15 | ->addMetadataDir(__DIR__, 'Symfony\\Component\\EventDispatcher') |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | return $builder; |
19 | 19 | }; |
20 | 20 | |
21 | - $app['serializer'] = function () use ($app) { |
|
21 | + $app['serializer'] = function() use ($app) { |
|
22 | 22 | return $app['serializer.builder']->build(); |
23 | 23 | }; |
24 | 24 | } |