@@ -27,22 +27,22 @@ public function handle(CommandInterface $command, $priority = null)
2727 {
2828 try {
2929 $ this ->eventDispatcher ->dispatch (
30- Event \Events:: PRE_HANDLE_COMMAND ,
31- new Event \PreHandleCommandEvent ( $ this -> getHandleType (), $ command )
30+ new Event \PreHandleCommandEvent ( $ this -> getHandleType (), $ command ) ,
31+ Event \Events:: PRE_HANDLE_COMMAND
3232 );
3333
3434 $ result = $ this ->delegateCommandBus ->handle ($ command , $ priority );
3535
3636 $ this ->eventDispatcher ->dispatch (
37- Event \Events:: ON_DIRECT_RESPONSE ,
38- new Event \OnDirectResponseEvent ( $ this -> getHandleType (), new Response ( $ command , Response:: SUCCESS ))
37+ new Event \OnDirectResponseEvent ( $ this -> getHandleType (), new Response ( $ command , Response:: SUCCESS )) ,
38+ Event \Events:: ON_DIRECT_RESPONSE
3939 );
4040
4141 return $ result ;
4242 } catch (\Exception $ e ) {
4343 $ this ->eventDispatcher ->dispatch (
44- Event \Events:: ON_DIRECT_RESPONSE ,
45- new Event \OnDirectResponseEvent ( $ this -> getHandleType (), new Response ( $ command , Response:: FAILED , $ e ))
44+ new Event \OnDirectResponseEvent ( $ this -> getHandleType (), new Response ( $ command , Response:: FAILED , $ e )) ,
45+ Event \Events:: ON_DIRECT_RESPONSE
4646 );
4747
4848 throw $ e ;
0 commit comments