@@ -17,7 +17,7 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public function extract($command) |
| 19 | 19 | { |
| 20 | - if (! is_object($command)) { |
|
| 20 | + if (!is_object($command)) { |
|
| 21 | 21 | throw new \InvalidArgumentException("Command must be an object"); |
| 22 | 22 | } |
| 23 | 23 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | $handlerObject = $this->app[$handlerClassName]; |
| 37 | 37 | |
| 38 | - if (! is_object($handlerObject)) { |
|
| 38 | + if (!is_object($handlerObject)) { |
|
| 39 | 39 | throw new \InvalidArgumentException(sprintf( |
| 40 | 40 | 'Class %s is not registered in container', |
| 41 | 41 | $handlerClassName |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public function addHandler($commandClassName, $handlerClassName) |
| 53 | 53 | { |
| 54 | - if (! class_exists($handlerClassName)) { |
|
| 54 | + if (!class_exists($handlerClassName)) { |
|
| 55 | 55 | throw new \InvalidArgumentException(sprintf( |
| 56 | 56 | 'Handler class %s not found', |
| 57 | 57 | $handlerClassName |
@@ -51,15 +51,15 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // register default locator if haven't defined yet |
| 54 | - if (! $app->offsetExists('tactician.locator')) { |
|
| 55 | - $app['tactician.locator'] = function () use ($app) { |
|
| 54 | + if (!$app->offsetExists('tactician.locator')) { |
|
| 55 | + $app['tactician.locator'] = function() use ($app) { |
|
| 56 | 56 | return new SilexLocator($app); |
| 57 | 57 | }; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | // register default command extractor if haven't defined yet |
| 61 | - if (! $app->offsetExists('tactician.command_extractor')) { |
|
| 62 | - $app['tactician.command_extractor'] = function () { |
|
| 61 | + if (!$app->offsetExists('tactician.command_extractor')) { |
|
| 62 | + $app['tactician.command_extractor'] = function() { |
|
| 63 | 63 | return new SilexCommandExtractor(); |
| 64 | 64 | }; |
| 65 | 65 | } |
@@ -69,23 +69,23 @@ discard block |
||
| 69 | 69 | $app['tactician.inflector'] = $this->resolveStringBaseMethodInflector($app['tactician.inflector']); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - $app['tactician.command_bus'] = function () use ($app) { |
|
| 72 | + $app['tactician.command_bus'] = function() use ($app) { |
|
| 73 | 73 | // type checking, make sure all command bus component are valid |
| 74 | - if (! $app['tactician.command_extractor'] instanceof CommandNameExtractor) { |
|
| 74 | + if (!$app['tactician.command_extractor'] instanceof CommandNameExtractor) { |
|
| 75 | 75 | throw new \InvalidArgumentException(sprintf( |
| 76 | 76 | 'Tactician command extractor must implement %s', |
| 77 | 77 | CommandNameExtractor::class |
| 78 | 78 | )); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - if (! $app['tactician.locator'] instanceof HandlerLocator) { |
|
| 81 | + if (!$app['tactician.locator'] instanceof HandlerLocator) { |
|
| 82 | 82 | throw new \InvalidArgumentException(sprintf( |
| 83 | 83 | 'Tactician locator must implement %s', |
| 84 | 84 | HandlerLocator::class |
| 85 | 85 | )); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - if (! $app['tactician.inflector'] instanceof MethodNameInflector) { |
|
| 88 | + if (!$app['tactician.inflector'] instanceof MethodNameInflector) { |
|
| 89 | 89 | throw new \InvalidArgumentException(sprintf( |
| 90 | 90 | 'Tactician inflector must implement %s', |
| 91 | 91 | MethodNameInflector::class |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | // combine middleware toggether |
| 102 | 102 | $middleware = $app['tactician.middleware']; |
| 103 | - array_walk($middleware, function (&$value) { |
|
| 103 | + array_walk($middleware, function(&$value) { |
|
| 104 | 104 | $value = $this->resolveMiddleware($value); |
| 105 | 105 | }); |
| 106 | 106 | array_push($middleware, $handler_middleware); |
@@ -117,27 +117,27 @@ discard block |
||
| 117 | 117 | { |
| 118 | 118 | switch ($string) { |
| 119 | 119 | case 'class_name': |
| 120 | - $inflector = function () { |
|
| 120 | + $inflector = function() { |
|
| 121 | 121 | return new HandleClassNameInflector(); |
| 122 | 122 | }; |
| 123 | 123 | break; |
| 124 | 124 | case 'class_name_without_suffix': |
| 125 | - $inflector = function () { |
|
| 125 | + $inflector = function() { |
|
| 126 | 126 | return new HandleClassNameWithoutSuffixInflector(); |
| 127 | 127 | }; |
| 128 | 128 | break; |
| 129 | 129 | case 'handle': |
| 130 | - $inflector = function () { |
|
| 130 | + $inflector = function() { |
|
| 131 | 131 | return new HandleInflector(); |
| 132 | 132 | }; |
| 133 | 133 | break; |
| 134 | 134 | case 'invoke': |
| 135 | - $inflector = function () { |
|
| 135 | + $inflector = function() { |
|
| 136 | 136 | return new InvokeInflector(); |
| 137 | 137 | }; |
| 138 | 138 | break; |
| 139 | 139 | default: |
| 140 | - $inflector = function () { |
|
| 140 | + $inflector = function() { |
|
| 141 | 141 | return new HandleClassNameInflector(); |
| 142 | 142 | }; |
| 143 | 143 | break; |