Completed
Push — master ( 6ecc4c...c85972 )
by Ivannis Suárez
11:44
created
Tests/Units/Event/EventBusTests.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
             ->given($middleware = new LockingMiddleware())
37 37
             ->and($eventBus = new EventBus([$middleware]))
38 38
             ->then()
39
-                ->exception(function () use ($eventBus) {
39
+                ->exception(function() use ($eventBus) {
40 40
                     $eventBus->dispatch(new LoginUserEvent('[email protected]'));
41 41
                 })
42 42
                 ->isInstanceOf(NotFoundException::class)
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         $this
52 52
             ->given($eventBus = EventBus::create())
53 53
             ->and($event = new LoginUserEvent('[email protected]'))
54
-            ->and($eventBus->addListener($event->eventName(), function (LoginUserEvent $event) {
54
+            ->and($eventBus->addListener($event->eventName(), function(LoginUserEvent $event) {
55 55
                 $this
56 56
                     ->string($event->email())
57 57
                     ->isEqualTo('[email protected]')
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $this
75 75
             ->given($eventBus = EventBus::create())
76 76
             ->then()
77
-                ->exception(function () use ($eventBus) {
77
+                ->exception(function() use ($eventBus) {
78 78
                     $eventBus->dispatch(new FooMessage());
79 79
                 })
80 80
                 ->isInstanceOf(\InvalidArgumentException::class)
@@ -103,10 +103,10 @@  discard block
 block discarded – undo
103 103
         $this
104 104
             ->given($eventBus = EventBus::create())
105 105
             ->and($eventBus->addListener('event.foo', array(new LoginUserEventListener(), 'onLogin')))
106
-            ->and($eventBus->addListener('event.foo', function (Event $event) {
106
+            ->and($eventBus->addListener('event.foo', function(Event $event) {
107 107
 
108 108
             }))
109
-            ->and($eventBus->addListener('event.bar', function (Event $event) {
109
+            ->and($eventBus->addListener('event.bar', function(Event $event) {
110 110
 
111 111
             }))
112 112
             ->when($listeners = $eventBus->listeners())
@@ -130,10 +130,10 @@  discard block
 block discarded – undo
130 130
         $this
131 131
             ->given($eventBus = EventBus::create())
132 132
             ->and($listener1 = array(new LoginUserEventListener(), 'onLogin'))
133
-            ->and($listener2 = function (Event $event) {
133
+            ->and($listener2 = function(Event $event) {
134 134
                 return $event->eventName();
135 135
             })
136
-            ->and($listener3 = function (Event $event) {
136
+            ->and($listener3 = function(Event $event) {
137 137
 
138 138
             })
139 139
             ->and($eventBus->addListener('event.foo', $listener1, 100))
Please login to merge, or discard this patch.
Tests/Units/Middlewares/EventDispatcher/EventDispatcherMiddlewareTests.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
             ->and($middleware = new EventDispatcherMiddleware($dispatcher))
34 34
             ->and($event = new LoginUserEvent('[email protected]'))
35 35
             ->and($dispatcher->addListener($event->eventName(), array(new LoginUserEventListener(), 'onLogin')))
36
-            ->and($dispatcher->addListener($event->eventName(), function (LoginUserEvent $event) {
36
+            ->and($dispatcher->addListener($event->eventName(), function(LoginUserEvent $event) {
37 37
                 $this
38 38
                     ->string($event->email())
39 39
                     ->isEqualTo('[email protected]')
@@ -41,14 +41,14 @@  discard block
 block discarded – undo
41 41
 
42 42
                 $event->setEmail('[email protected]');
43 43
             }))
44
-            ->and($callable = function (LoginUserEvent $event) {
44
+            ->and($callable = function(LoginUserEvent $event) {
45 45
                 $event->setEmail('[email protected]');
46 46
             })
47 47
             ->when($result = $middleware->handle($event, $callable))
48 48
             ->then()
49 49
                 ->string($event->email())
50 50
                     ->isEqualTo('[email protected]')
51
-                ->exception(function () use ($middleware, $callable) {
51
+                ->exception(function() use ($middleware, $callable) {
52 52
                     $middleware->handle(new \StdClass(), $callable);
53 53
                 })->isInstanceOf(\InvalidArgumentException::class)
54 54
         ;
Please login to merge, or discard this patch.