Completed
Push — master ( 33ba9e...1e863f )
by Ivannis Suárez
05:17
created
Middlewares/Locking/LockingMiddleware.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
      */
41 41
     public function handle($message, callable $next)
42 42
     {
43
-        $this->queue[] = Delegate::fromClosure(function () use ($message, $next) {
43
+        $this->queue[] = Delegate::fromClosure(function() use ($message, $next) {
44 44
             return $next($message);
45 45
         });
46 46
 
Please login to merge, or discard this patch.
Bus.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
             }
155 155
         }
156 156
 
157
-        $next = Delegate::fromClosure(function ($message) {
157
+        $next = Delegate::fromClosure(function($message) {
158 158
             // the final middleware return the same message
159 159
             return $message;
160 160
         });
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         // reverse iteration over middlewares
163 163
         /** @var MiddlewareInterface $middleware */
164 164
         while ($middleware = array_pop($middlewares)) {
165
-            $next = Delegate::fromClosure(function ($message) use ($middleware, $next) {
165
+            $next = Delegate::fromClosure(function($message) use ($middleware, $next) {
166 166
                 return $middleware->handle($message, $next);
167 167
             });
168 168
         }
Please login to merge, or discard this patch.
Tests/Units/BusTests.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         $this
30 30
             ->given($middleware = new LockingMiddleware())
31 31
             ->then()
32
-                ->exception(function () use ($middleware) {
32
+                ->exception(function() use ($middleware) {
33 33
                     new Bus([$middleware, new \StdClass()]);
34 34
                 })
35 35
                 ->isInstanceOf(InvalidMiddlewareException::class)
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
             ->given($middleware = new LockingMiddleware())
70 70
             ->and($bus = new Bus())
71 71
             ->then()
72
-                ->exception(function () use ($bus, $middleware) {
72
+                ->exception(function() use ($bus, $middleware) {
73 73
                     $bus->addMiddlewareBefore($middleware, $middleware);
74 74
                 })->isInstanceOf(\InvalidArgumentException::class)
75 75
         ;
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
             ->given($middleware = new LockingMiddleware())
94 94
             ->and($bus = new Bus())
95 95
             ->then()
96
-                ->exception(function () use ($bus, $middleware) {
96
+                ->exception(function() use ($bus, $middleware) {
97 97
                     $bus->addMiddlewareAfter($middleware, $middleware);
98 98
                 })->isInstanceOf(\InvalidArgumentException::class)
99 99
         ;
Please login to merge, or discard this patch.
Tests/Units/Middlewares/Handler/MessageHandlerMiddlewareTests.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,14 +41,14 @@
 block discarded – undo
41 41
             )
42 42
             ->and($middleware = new MessageHandlerMiddleware($resolver))
43 43
             ->and($command = new LoginUserMessage('[email protected]', 'plainpassword'))
44
-            ->and($callable = function (LoginUserMessage $command) {
44
+            ->and($callable = function(LoginUserMessage $command) {
45 45
                 $command->setEmail('[email protected]');
46 46
             })
47 47
             ->when($middleware->handle($command, $callable))
48 48
             ->then()
49 49
                 ->string($command->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.
Tests/Units/Middlewares/Locking/LockingMiddlewareTests.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         $this
32 32
             ->given($middleware = new LockingMiddleware())
33 33
             ->and($event = new LoginUserMessage('[email protected]'))
34
-            ->and($callable = function (LoginUserMessage $event) {
34
+            ->and($callable = function(LoginUserMessage $event) {
35 35
                 $event->setEmail('[email protected]');
36 36
             })
37 37
             ->when($middleware->handle($event, $callable))
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
         $this
44 44
             ->given($middleware = new LockingMiddleware())
45 45
             ->and($event = new LoginUserMessage('[email protected]'))
46
-            ->and($callable = function (LoginUserMessage $event) {
46
+            ->and($callable = function(LoginUserMessage $event) {
47 47
                 $event->setEmail('[email protected]');
48 48
 
49 49
                 throw new \InvalidArgumentException();
50 50
             })
51 51
             ->then()
52
-                ->exception(function () use ($middleware, $event, $callable) {
52
+                ->exception(function() use ($middleware, $event, $callable) {
53 53
                     $middleware->handle($event, $callable);
54 54
                 })
55 55
                 ->isInstanceOf(\InvalidArgumentException::class)
@@ -57,12 +57,12 @@  discard block
 block discarded – undo
57 57
 
58 58
         $this
59 59
             ->given($middleware = new LockingMiddleware())
60
-            ->and($callable = function (LoginUserMessage $event) {
60
+            ->and($callable = function(LoginUserMessage $event) {
61 61
                 $event->setEmail(md5($event->email()));
62 62
             })
63 63
             ->and($listener = new TriggerMessageOnListener($middleware, $callable))
64 64
             ->and($event = new LoginUserMessage('[email protected]'))
65
-            ->when($middleware->handle($event, function ($event) use ($listener) {
65
+            ->when($middleware->handle($event, function($event) use ($listener) {
66 66
                 $listener->onLogin($event);
67 67
             }))
68 68
             ->then()
Please login to merge, or discard this patch.
Handler/Resolver/NameOfMessage/FromMessageNamedResolverTests.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
         $this
39 39
             ->given($resolver = new FromMessageNamedResolver())
40 40
             ->then()
41
-                ->exception(function () use ($resolver) {
41
+                ->exception(function() use ($resolver) {
42 42
                     $resolver->resolve(new LoginUserMessage('[email protected]', 'plainpassword'));
43 43
                 })
44 44
                 ->isInstanceOf(\InvalidArgumentException::class)
Please login to merge, or discard this patch.
Units/Middlewares/Handler/Resolver/NameOfMessage/ChainResolverTests.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
         $this
49 49
             ->given($resolver = new ChainResolver([]))
50 50
             ->then()
51
-                ->exception(function () use ($resolver) {
51
+                ->exception(function() use ($resolver) {
52 52
                     $resolver->resolve(new LogoutUserMessage('[email protected]'));
53 53
                 })
54 54
                 ->isInstanceOf(NotFoundException::class)
Please login to merge, or discard this patch.
Middlewares/Handler/Resolver/HandlerClass/HandlerClassResolverTests.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
             )
60 60
             ->and($resolver->addHandler(LoginUserMessage::class, new LoginUserMessageListener()))
61 61
             ->then()
62
-                ->exception(function () use ($resolver) {
62
+                ->exception(function() use ($resolver) {
63 63
                     $resolver->resolve(new LogoutUserMessage('[email protected]'));
64 64
                 })
65 65
                 ->isInstanceOf(NotFoundException::class)
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
                 )
75 75
             )
76 76
             ->then()
77
-                ->exception(function () use ($resolver) {
77
+                ->exception(function() use ($resolver) {
78 78
                     $resolver->resolve(new LoginUserMessage('[email protected]'));
79 79
                 })
80 80
                 ->isInstanceOf(NotFoundException::class)
Please login to merge, or discard this patch.
Tests/Units/Middlewares/Validator/ValidatorMiddlewareTests.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             )
52 52
             ->and($middleware = new ValidatorMiddleware($resolver))
53 53
             ->and($command = new LoginUserMessage('[email protected]', 'plainpassword'))
54
-            ->and($callable = function (LoginUserMessage $command) {
54
+            ->and($callable = function(LoginUserMessage $command) {
55 55
                 $command->setEmail('[email protected]');
56 56
             })
57 57
             ->when($middleware->handle($command, $callable))
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
             ->and()
62 62
             ->when($command = new LoginUserMessage('[email protected]', 'plainpassword'))
63 63
             ->then()
64
-                ->exception(function () use ($middleware, $command, $callable) {
64
+                ->exception(function() use ($middleware, $command, $callable) {
65 65
                     $middleware->handle($command, $callable);
66 66
                 })->isInstanceOf(ValidationException::class)
67 67
         ;
@@ -80,10 +80,10 @@  discard block
 block discarded – undo
80 80
             )
81 81
             ->and($middleware = new ValidatorMiddleware($resolver))
82 82
             ->and($command = new LoginUserMessage('invalid.email.com', 'plainpassword'))
83
-            ->and($callable = function () {
83
+            ->and($callable = function() {
84 84
             })
85 85
             ->then()
86
-                ->exception(function () use ($middleware, $command, $callable) {
86
+                ->exception(function() use ($middleware, $command, $callable) {
87 87
                     $middleware->handle($command, $callable);
88 88
                 })->isInstanceOf(ValidationException::class)
89 89
         ;
@@ -102,11 +102,11 @@  discard block
 block discarded – undo
102 102
             )
103 103
             ->and($middleware = new ValidatorMiddleware($resolver))
104 104
             ->and($command = new LogoutUserMessage('invalid.email.com'))
105
-            ->and($callable = function (LogoutUserMessage $command) {
105
+            ->and($callable = function(LogoutUserMessage $command) {
106 106
                 $command->setEmail('[email protected]');
107 107
             })
108 108
             ->then()
109
-                ->exception(function () use ($middleware, $command, $callable) {
109
+                ->exception(function() use ($middleware, $command, $callable) {
110 110
                     $middleware->handle($command, $callable);
111 111
                 })->isInstanceOf(ValidationException::class)
112 112
         ;
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
             )
126 126
             ->and($middleware = new ValidatorMiddleware($resolver))
127 127
             ->and($command = new RemoveUserMessage('[email protected]'))
128
-            ->and($callable = function (RemoveUserMessage $command) {
128
+            ->and($callable = function(RemoveUserMessage $command) {
129 129
                 $command->setEmail('[email protected]');
130 130
             })
131 131
             ->when($middleware->handle($command, $callable))
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
             )
149 149
             ->and($middleware = new ValidatorMiddleware($resolver))
150 150
             ->and($command = new RemoveUserMessage('[email protected]'))
151
-            ->and($callable = function (RemoveUserMessage $command) {
151
+            ->and($callable = function(RemoveUserMessage $command) {
152 152
                 $command->setEmail('[email protected]');
153 153
             })
154 154
             ->then()
155
-                ->exception(function () use ($middleware, $command, $callable) {
155
+                ->exception(function() use ($middleware, $command, $callable) {
156 156
                     $middleware->handle($command, $callable);
157 157
                 })->isInstanceOf(NotFoundException::class)
158 158
         ;
Please login to merge, or discard this patch.