@@ -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 | } |
@@ -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 | |
@@ -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 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | { |
| 18 | 18 | $controllers = $app['controllers_factory']; |
| 19 | 19 | |
| 20 | - $controllers->post('/access-token', function (Request $request) use ($app) { |
|
| 20 | + $controllers->post('/access-token', function(Request $request) use ($app) { |
|
| 21 | 21 | try { |
| 22 | 22 | $token = $app['sandstone.oauth.controller']->postAccessToken($request); |
| 23 | 23 | |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | public function send($message) |
| 32 | 32 | { |
| 33 | 33 | $this->pushServer->send($message); |
| 34 | - $this->sentMessages []= $message; |
|
| 34 | + $this->sentMessages [] = $message; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | $this->data['messages_size'] += $messageSize; |
| 56 | 56 | $this->data['messages_count']++; |
| 57 | 57 | |
| 58 | - $this->data['messages'] []= array( |
|
| 58 | + $this->data['messages'] [] = array( |
|
| 59 | 59 | 'content' => $message, |
| 60 | 60 | 'size' => $messageSize, |
| 61 | 61 | 'decoded' => unserialize($message), |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | public function register(Container $app) |
| 17 | 17 | { |
| 18 | - $app['sandstone.push'] = function () use ($app) { |
|
| 18 | + $app['sandstone.push'] = function() use ($app) { |
|
| 19 | 19 | $pushServerHost = $app['sandstone.push.server']['host']; |
| 20 | 20 | $pushServerPort = $app['sandstone.push.server']['port']; |
| 21 | 21 | |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | $app = new App\AppRestApi([ |
| 16 | 16 | 'debug' => true, |
| 17 | - 'sandstone.push' => function () use ($pushServerMock) { |
|
| 17 | + 'sandstone.push' => function() use ($pushServerMock) { |
|
| 18 | 18 | return $pushServerMock; |
| 19 | 19 | }, |
| 20 | 20 | ]); |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | $pushServerMock |
| 25 | 25 | ->expects($this->once()) |
| 26 | 26 | ->method('send') |
| 27 | - ->with($this->callback(function ($message) { |
|
| 27 | + ->with($this->callback(function($message) { |
|
| 28 | 28 | $decodedMessage = unserialize($message); |
| 29 | 29 | $serializedEvent = '{"propagation_stopped":false,"id":42,"title":"Unicorns spotted in Alaska","url":"http:\/\/unicorn.com\/articles\/unicorns-spotted-alaska"}'; |
| 30 | 30 | |