@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Pimple\ServiceProviderInterface; |
| 6 | 6 | use Pimple\Container; |
| 7 | -use Eole\WebSocket\Routing\TopicRoute; |
|
| 8 | 7 | |
| 9 | 8 | class WebsocketProvider implements ServiceProviderInterface |
| 10 | 9 | { |
@@ -13,16 +13,16 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function register(Container $app) |
| 15 | 15 | { |
| 16 | - $app->topic('eole/core/chat', function ($topicPattern) { |
|
| 16 | + $app->topic('eole/core/chat', function($topicPattern) { |
|
| 17 | 17 | return new \Eole\WebSocket\Topic\ChatTopic($topicPattern); |
| 18 | 18 | }); |
| 19 | 19 | |
| 20 | - $app->topic('eole/core/parties', function ($topicPattern) { |
|
| 20 | + $app->topic('eole/core/parties', function($topicPattern) { |
|
| 21 | 21 | return new \Eole\WebSocket\Topic\PartiesTopic($topicPattern); |
| 22 | 22 | }); |
| 23 | 23 | |
| 24 | 24 | $app |
| 25 | - ->topic('eole/core/game/{game_name}/parties', function ($topicPattern, $arguments) { |
|
| 25 | + ->topic('eole/core/game/{game_name}/parties', function($topicPattern, $arguments) { |
|
| 26 | 26 | return new \Eole\WebSocket\Topic\PartiesTopic($topicPattern, $arguments); |
| 27 | 27 | }) |
| 28 | 28 | ->assert('game_name', '^[a-z0-9_\-]+$') |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | public function register(Container $app) |
| 18 | 18 | { |
| 19 | - $app['eole.games.awale.controller'] = function () use ($app) { |
|
| 19 | + $app['eole.games.awale.controller'] = function() use ($app) { |
|
| 20 | 20 | return new RestApi\Controller( |
| 21 | 21 | $app['orm.em']->getRepository('EoleAwale:AwaleParty'), |
| 22 | 22 | $app['orm.em'], |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | ); |
| 26 | 26 | }; |
| 27 | 27 | |
| 28 | - $app->before(function () use ($app) { |
|
| 28 | + $app->before(function() use ($app) { |
|
| 29 | 29 | if (null !== $app['user']) { |
| 30 | 30 | $app['eole.games.awale.controller']->setLoggedPlayer($app['user']); |
| 31 | 31 | } |
@@ -22,15 +22,15 @@ |
||
| 22 | 22 | 'Eole\\Games\\Awale' |
| 23 | 23 | ); |
| 24 | 24 | |
| 25 | - $app->extend('eole.mappings', function ($mappings, $app) { |
|
| 26 | - $mappings []= array( |
|
| 25 | + $app->extend('eole.mappings', function($mappings, $app) { |
|
| 26 | + $mappings [] = array( |
|
| 27 | 27 | 'type' => 'yml', |
| 28 | 28 | 'namespace' => 'Alcalyn\\Awale', |
| 29 | 29 | 'path' => $app['project.root'].'/src/Eole/Games/Awale/Mapping', |
| 30 | 30 | 'alias' => 'Awale', |
| 31 | 31 | ); |
| 32 | 32 | |
| 33 | - $mappings []= array( |
|
| 33 | + $mappings [] = array( |
|
| 34 | 34 | 'type' => 'yml', |
| 35 | 35 | 'namespace' => 'Eole\\Games\\Awale\\Model', |
| 36 | 36 | 'path' => $app['project.root'].'/src/Eole/Games/Awale/Mapping', |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | public function register(Container $app) |
| 12 | 12 | { |
| 13 | 13 | $app |
| 14 | - ->topic('eole/games/awale/parties/{party_id}', function ($topicPattern, $arguments) { |
|
| 14 | + ->topic('eole/games/awale/parties/{party_id}', function($topicPattern, $arguments) { |
|
| 15 | 15 | return new AwaleTopic($topicPattern, intval($arguments['party_id'])); |
| 16 | 16 | }) |
| 17 | 17 | ->assert('party_id', '^[0-9]+$') |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | public function register(Container $app) |
| 11 | 11 | { |
| 12 | 12 | $app |
| 13 | - ->topic('eole/games/tictactoe/parties/{party_id}', function ($topicPattern, $arguments) use ($app) { |
|
| 13 | + ->topic('eole/games/tictactoe/parties/{party_id}', function($topicPattern, $arguments) use ($app) { |
|
| 14 | 14 | $partyId = $arguments['party_id']; |
| 15 | 15 | $partyRepository = $app['orm.em']->getRepository('Eole:Party'); |
| 16 | 16 | $party = $partyRepository->findFullPartyById($partyId, 'tictactoe'); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | private function registerSecurity() |
| 93 | 93 | { |
| 94 | - $userProvider = function () { |
|
| 94 | + $userProvider = function() { |
|
| 95 | 95 | return new \Alcalyn\UserApi\Security\UserProvider($this['eole.player_api']); |
| 96 | 96 | }; |
| 97 | 97 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | ), |
| 108 | 108 | )); |
| 109 | 109 | |
| 110 | - $this['security.default_encoder'] = function () { |
|
| 110 | + $this['security.default_encoder'] = function() { |
|
| 111 | 111 | return $this['security.encoder.digest']; |
| 112 | 112 | }; |
| 113 | 113 | |
@@ -208,10 +208,10 @@ discard block |
||
| 208 | 208 | ], |
| 209 | 209 | ]); |
| 210 | 210 | |
| 211 | - $this['eole.mappings'] = function () { |
|
| 211 | + $this['eole.mappings'] = function() { |
|
| 212 | 212 | $mappings = array(); |
| 213 | 213 | |
| 214 | - $mappings []= array( |
|
| 214 | + $mappings [] = array( |
|
| 215 | 215 | 'type' => 'yml', |
| 216 | 216 | 'namespace' => 'Alcalyn\UserApi\Model', |
| 217 | 217 | 'path' => $this['project.root'].'/vendor/alcalyn/doctrine-user-api/Mapping', |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | return $mappings; |
| 221 | 221 | }; |
| 222 | 222 | |
| 223 | - $this['eole.listener.authorization_header_fix'] = function () { |
|
| 223 | + $this['eole.listener.authorization_header_fix'] = function() { |
|
| 224 | 224 | return new \Alcalyn\AuthorizationHeaderFix\AuthorizationHeaderFixListener(); |
| 225 | 225 | }; |
| 226 | 226 | } |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | */ |
| 262 | 262 | private function logErrors() |
| 263 | 263 | { |
| 264 | - $this->error(function (\Exception $e) { |
|
| 264 | + $this->error(function(\Exception $e) { |
|
| 265 | 265 | $logFile = $this['project.root'].'/var/logs/errors.txt'; |
| 266 | 266 | $message = get_class($e).' '.$e->getMessage().PHP_EOL.$e->getTraceAsString().PHP_EOL.PHP_EOL; |
| 267 | 267 | file_put_contents($logFile, $message, FILE_APPEND); |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | 'debug' => true, |
| 43 | 43 | )); |
| 44 | 44 | |
| 45 | - $app['eole.oauth.resource_server'] = function () use ($app) { |
|
| 45 | + $app['eole.oauth.resource_server'] = function() use ($app) { |
|
| 46 | 46 | return new ResourceServerMock( |
| 47 | 47 | $app['eole.oauth.storage.session'], |
| 48 | 48 | $app['eole.oauth.storage.access_token'], |
@@ -147,11 +147,11 @@ |
||
| 147 | 147 | |
| 148 | 148 | $client->request('POST', '/api/players/guest'); |
| 149 | 149 | $this->assertEquals(Response::HTTP_CREATED, $client->getResponse()->getStatusCode(), 'Creating first guest.'); |
| 150 | - $guests []= json_decode($client->getResponse()->getContent()); |
|
| 150 | + $guests [] = json_decode($client->getResponse()->getContent()); |
|
| 151 | 151 | |
| 152 | 152 | $client->request('POST', '/api/players/guest'); |
| 153 | 153 | $this->assertEquals(Response::HTTP_CREATED, $client->getResponse()->getStatusCode(), 'Creating second guest.'); |
| 154 | - $guests []= json_decode($client->getResponse()->getContent()); |
|
| 154 | + $guests [] = json_decode($client->getResponse()->getContent()); |
|
| 155 | 155 | |
| 156 | 156 | $this->assertNotEquals($guests[0]->id, $guests[1]->id, 'Comparing guests ids.'); |
| 157 | 157 | $this->assertNotEquals($guests[0]->username, $guests[1]->username, 'Comparing guests usernames.'); |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | $installedGamesNames = array(); |
| 51 | 51 | |
| 52 | 52 | foreach ($installedGames as $game) { |
| 53 | - $installedGamesNames []= $game->getName(); |
|
| 53 | + $installedGamesNames [] = $game->getName(); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | $newDetectedGames = array_diff(array_keys($gameProviders), $installedGamesNames); |