@@ -41,14 +41,14 @@  | 
                                                    ||
| 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 | ;  | 
                                                        
@@ -38,7 +38,7 @@  | 
                                                    ||
| 38 | 38 | $this  | 
                                                        
| 39 | 39 | ->given($resolver = new FromCommandNamedResolver())  | 
                                                        
| 40 | 40 | ->then()  | 
                                                        
| 41 | -                ->exception(function () use ($resolver) { | 
                                                        |
| 41 | +                ->exception(function() use ($resolver) { | 
                                                        |
| 42 | 42 |                      $resolver->resolve(new LoginUserCommand('[email protected]', 'plainpassword')); | 
                                                        
| 43 | 43 | })  | 
                                                        
| 44 | 44 | ->isInstanceOf(\InvalidArgumentException::class)  | 
                                                        
@@ -38,7 +38,7 @@  | 
                                                    ||
| 38 | 38 | $this  | 
                                                        
| 39 | 39 | ->given($resolver = new FromCommandNamedResolver())  | 
                                                        
| 40 | 40 | ->then()  | 
                                                        
| 41 | -                ->exception(function () use ($resolver) { | 
                                                        |
| 41 | +                ->exception(function() use ($resolver) { | 
                                                        |
| 42 | 42 |                      $resolver->resolve(new LoginUserCommand('[email protected]', 'plainpassword')); | 
                                                        
| 43 | 43 | })  | 
                                                        
| 44 | 44 | ->isInstanceOf(\InvalidArgumentException::class)  | 
                                                        
@@ -38,7 +38,7 @@  | 
                                                    ||
| 38 | 38 | $this  | 
                                                        
| 39 | 39 | ->given($resolver = new FromCommandNamedResolver())  | 
                                                        
| 40 | 40 | ->then()  | 
                                                        
| 41 | -                ->exception(function () use ($resolver) { | 
                                                        |
| 41 | +                ->exception(function() use ($resolver) { | 
                                                        |
| 42 | 42 |                      $resolver->resolve(new LoginUserCommand('[email protected]', 'plainpassword')); | 
                                                        
| 43 | 43 | })  | 
                                                        
| 44 | 44 | ->isInstanceOf(\InvalidArgumentException::class)  | 
                                                        
@@ -32,7 +32,7 @@ discard block  | 
                                                    ||
| 32 | 32 | $this  | 
                                                        
| 33 | 33 | ->given($middleware = new ValidatorMiddleware())  | 
                                                        
| 34 | 34 |              ->and($command = new LoginUserMessage('[email protected]', 'plainpassword')) | 
                                                        
| 35 | -            ->and($callable = function (LoginUserMessage $command) { | 
                                                        |
| 35 | +            ->and($callable = function(LoginUserMessage $command) { | 
                                                        |
| 36 | 36 |                  $command->setEmail('[email protected]'); | 
                                                        
| 37 | 37 | })  | 
                                                        
| 38 | 38 | ->when($middleware->handle($command, $callable))  | 
                                                        
@@ -44,10 +44,10 @@ discard block  | 
                                                    ||
| 44 | 44 | $this  | 
                                                        
| 45 | 45 | ->given($middleware = new ValidatorMiddleware())  | 
                                                        
| 46 | 46 |              ->and($command = new LoginUserMessage('invalid.email.com', 'plainpassword')) | 
                                                        
| 47 | -            ->and($callable = function () { | 
                                                        |
| 47 | +            ->and($callable = function() { | 
                                                        |
| 48 | 48 | })  | 
                                                        
| 49 | 49 | ->then()  | 
                                                        
| 50 | -                ->exception(function () use ($middleware, $command, $callable) { | 
                                                        |
| 50 | +                ->exception(function() use ($middleware, $command, $callable) { | 
                                                        |
| 51 | 51 | $middleware->handle($command, $callable);  | 
                                                        
| 52 | 52 | })->isInstanceOf(ValidationException::class)  | 
                                                        
| 53 | 53 | ;  | 
                                                        
@@ -55,7 +55,7 @@ discard block  | 
                                                    ||
| 55 | 55 | $this  | 
                                                        
| 56 | 56 | ->given($middleware = new ValidatorMiddleware())  | 
                                                        
| 57 | 57 |              ->and($command = new LogoutUserMessage('invalid.email.com')) | 
                                                        
| 58 | -            ->and($callable = function (LogoutUserMessage $command) { | 
                                                        |
| 58 | +            ->and($callable = function(LogoutUserMessage $command) { | 
                                                        |
| 59 | 59 |                  $command->setEmail('[email protected]'); | 
                                                        
| 60 | 60 | })  | 
                                                        
| 61 | 61 | ->when($middleware->handle($command, $callable))  | 
                                                        
@@ -31,7 +31,7 @@ discard block  | 
                                                    ||
| 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  | 
                                                    ||
| 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  | 
                                                    ||
| 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()  |