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