@@ -11,7 +11,7 @@ |
||
11 | 11 | { |
12 | 12 | $app = new App\App(); |
13 | 13 | |
14 | - $app->topic('articles', function ($topicPattern) { |
|
14 | + $app->topic('articles', function($topicPattern) { |
|
15 | 15 | return new App\ArticleTopic($topicPattern); |
16 | 16 | }); |
17 | 17 |
@@ -8,7 +8,7 @@ |
||
8 | 8 | { |
9 | 9 | parent::__construct($values); |
10 | 10 | |
11 | - $this->topic('articles', function ($topicPattern, $arguments) { |
|
11 | + $this->topic('articles', function($topicPattern, $arguments) { |
|
12 | 12 | $channelName = $arguments['channel']; |
13 | 13 | |
14 | 14 | return new ArticleTopic($topicPattern, $channelName); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $app['sandstone.push.enabled'] = true; |
17 | 17 | } |
18 | 18 | |
19 | - $app['sandstone.push.event_serializer'] = function () use ($app) { |
|
19 | + $app['sandstone.push.event_serializer'] = function() use ($app) { |
|
20 | 20 | if (!$app->offsetExists('serializer')) { |
21 | 21 | throw new \RuntimeException('A serializer must be registered'); |
22 | 22 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | return new EventSerializer($app['serializer']); |
25 | 25 | }; |
26 | 26 | |
27 | - $app['sandstone.push.event_forwarder'] = function () use ($app) { |
|
27 | + $app['sandstone.push.event_forwarder'] = function() use ($app) { |
|
28 | 28 | return new EventForwarder( |
29 | 29 | $app['sandstone.push'], |
30 | 30 | $app['dispatcher'], |
@@ -25,11 +25,11 @@ |
||
25 | 25 | return parent::create() |
26 | 26 | ->setSerializationContextFactory(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 | }) |
@@ -79,7 +79,7 @@ |
||
79 | 79 | |
80 | 80 | $pushServer->bind("tcp://$pushBind:$pushPort"); |
81 | 81 | |
82 | - $pushServer->on('message', function ($message) { |
|
82 | + $pushServer->on('message', function($message) { |
|
83 | 83 | $data = $this->sandstoneApplication['sandstone.push.event_serializer']->deserializeEvent($message); |
84 | 84 | |
85 | 85 | $this->logger->info('Push message event', ['event' => $data['name']]); |
@@ -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['sandstone.websocket.url_matcher']); |
34 | 34 | }; |
35 | 35 | } |
@@ -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 |
@@ -23,7 +23,7 @@ |
||
23 | 23 | $pushServerMock |
24 | 24 | ->expects($this->once()) |
25 | 25 | ->method('send') |
26 | - ->with($this->callback(function ($message) { |
|
26 | + ->with($this->callback(function($message) { |
|
27 | 27 | $decodedMessage = unserialize($message); |
28 | 28 | $serializedEvent = '{"propagation_stopped":false,"id":42,"title":"title","url":"url"}'; |
29 | 29 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | |
20 | 20 | $app->register(new SerializerServiceProvider()); |
21 | 21 | |
22 | - $app['sandstone.websocket.router'] = function () { |
|
22 | + $app['sandstone.websocket.router'] = function() { |
|
23 | 23 | $wrongTopic = new WrongTopic('my-topic'); |
24 | 24 | $topicRouterMock = $this->getMockBuilder(TopicRouter::class)->disableOriginalConstructor()->getMock(); |
25 | 25 |