@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$dir = __DIR__ . '/../src'; |
|
| 3 | +$dir = __DIR__.'/../src'; |
|
| 4 | 4 | |
| 5 | 5 | $iterator = Symfony\Component\Finder\Finder::create() |
| 6 | 6 | ->files() |
@@ -10,8 +10,8 @@ discard block |
||
| 10 | 10 | $options = [ |
| 11 | 11 | 'theme' => 'default', |
| 12 | 12 | 'title' => 'Laravel Tactician API Documentation', |
| 13 | - 'build_dir' => __DIR__ . '/../build/laravelTactician', |
|
| 14 | - 'cache_dir' => __DIR__ . '/../cache/laravelTactician', |
|
| 13 | + 'build_dir' => __DIR__.'/../build/laravelTactician', |
|
| 14 | + 'cache_dir' => __DIR__.'/../cache/laravelTactician', |
|
| 15 | 15 | ]; |
| 16 | 16 | |
| 17 | 17 | $sami = new Sami\Sami($iterator, $options); |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public static function forCommand($commandName) |
| 19 | 19 | { |
| 20 | - $exception = new self('Command History Was Emptied by ' . $commandName . ". You shouldn't see this!"); |
|
| 20 | + $exception = new self('Command History Was Emptied by '.$commandName.". You shouldn't see this!"); |
|
| 21 | 21 | $exception->commandName = $commandName; |
| 22 | 22 | |
| 23 | 23 | return $exception; |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public static function forCommand($commandName) |
| 19 | 19 | { |
| 20 | - $exception = new self('Redo Command History Is Empty ' . $commandName); |
|
| 20 | + $exception = new self('Redo Command History Is Empty '.$commandName); |
|
| 21 | 21 | $exception->commandName = $commandName; |
| 22 | 22 | |
| 23 | 23 | return $exception; |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public static function forCommand($commandName) |
| 19 | 19 | { |
| 20 | - $exception = new self('Command History Is Empty ' . $commandName); |
|
| 20 | + $exception = new self('Command History Is Empty '.$commandName); |
|
| 21 | 21 | $exception->commandName = $commandName; |
| 22 | 22 | |
| 23 | 23 | return $exception; |
@@ -46,19 +46,19 @@ discard block |
||
| 46 | 46 | { |
| 47 | 47 | $commandDispatched = parent::dispatch($command, $input, $middleware); |
| 48 | 48 | |
| 49 | - $this->pushCommandHistory( [clone $commandDispatched, $middleware] ); // Memento Pattern |
|
| 49 | + $this->pushCommandHistory([clone $commandDispatched, $middleware]); // Memento Pattern |
|
| 50 | 50 | |
| 51 | 51 | return $commandDispatched; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - private function pushCommandHistory (array $commandDispatchedAndMiddleware) |
|
| 54 | + private function pushCommandHistory(array $commandDispatchedAndMiddleware) |
|
| 55 | 55 | { |
| 56 | 56 | $this->commandHistory[++$this->commandHistoryCounter] = $commandDispatchedAndMiddleware; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | public function undo() |
| 60 | 60 | { |
| 61 | - try{ |
|
| 61 | + try { |
|
| 62 | 62 | $commandDispatchedAndMiddleware = $this->popCommandHistory(); |
| 63 | 63 | $this->pushRedoCommandHistory($commandDispatchedAndMiddleware); |
| 64 | 64 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | return $this->topCommandHistory()[0]; |
| 68 | 68 | |
| 69 | - }catch (CommandHistoryWasEmptiedException $exception){} |
|
| 69 | + }catch (CommandHistoryWasEmptiedException $exception) {} |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | private function popCommandHistory() |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | private function topCommandHistory() |
| 86 | 86 | { |
| 87 | - if ($this->commandHistoryCounter == -1){ |
|
| 87 | + if ($this->commandHistoryCounter == -1) { |
|
| 88 | 88 | throw new CommandHistoryWasEmptiedException(); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | private function popRedoCommandHistory() |
| 122 | 122 | { |
| 123 | - if( $this->reDoCommandHistoryCounter == -1 ) { |
|
| 123 | + if ($this->reDoCommandHistoryCounter == -1) { |
|
| 124 | 124 | throw new RedoCommandHistoryIsEmptyException(); |
| 125 | 125 | } |
| 126 | 126 | |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | |
| 67 | 67 | return $this->topCommandHistory()[0]; |
| 68 | 68 | |
| 69 | - }catch (CommandHistoryWasEmptiedException $exception){} |
|
| 69 | + } catch (CommandHistoryWasEmptiedException $exception){} |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | private function popCommandHistory() |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | public function execute($command, callable $next) |
| 22 | 22 | { |
| 23 | 23 | $pipeline = null; |
| 24 | - DB::transaction(function () use ($next, $command, &$pipeline) { |
|
| 24 | + DB::transaction(function() use ($next, $command, &$pipeline) { |
|
| 25 | 25 | $pipeline = $next($command); |
| 26 | 26 | }); |
| 27 | 27 | return $pipeline; |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | // Register Command Generator |
| 38 | 38 | $this->app->singleton( |
| 39 | - 'laravel-tactician.make.command', function ($app) { |
|
| 39 | + 'laravel-tactician.make.command', function($app) { |
|
| 40 | 40 | return new MakeTacticianCommandCommand($app['files']); |
| 41 | 41 | } |
| 42 | 42 | ); |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | // Register Handler Generator |
| 46 | 46 | $this->app->singleton( |
| 47 | - 'laravel-tactician.make.handler', function ($app) { |
|
| 47 | + 'laravel-tactician.make.handler', function($app) { |
|
| 48 | 48 | return new MakeTacticianHandlerCommand($app['files']); |
| 49 | 49 | } |
| 50 | 50 | ); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | // Register Comman+Handler Generator Command |
| 54 | 54 | $this->app->singleton( |
| 55 | - 'laravel-tactician.make.tactician', function () { |
|
| 55 | + 'laravel-tactician.make.tactician', function() { |
|
| 56 | 56 | return new MakeTacticianCommand(); |
| 57 | 57 | } |
| 58 | 58 | ); |
@@ -67,16 +67,16 @@ |
||
| 67 | 67 | |
| 68 | 68 | private function createExecutionChain($middlewareList, $executor) |
| 69 | 69 | { |
| 70 | - $lastCallable = function () { |
|
| 70 | + $lastCallable = function() { |
|
| 71 | 71 | // the final callable is a no-op |
| 72 | 72 | }; |
| 73 | 73 | |
| 74 | 74 | while ($middleware = array_pop($middlewareList)) { |
| 75 | - if (! $middleware instanceof Middleware) { |
|
| 75 | + if (!$middleware instanceof Middleware) { |
|
| 76 | 76 | throw InvalidMiddlewareException::forMiddleware($middleware); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - $lastCallable = function ($command) use ($middleware, $lastCallable, $executor) { |
|
| 79 | + $lastCallable = function($command) use ($middleware, $lastCallable, $executor) { |
|
| 80 | 80 | return $middleware->{$executor}($command, $lastCallable); |
| 81 | 81 | }; |
| 82 | 82 | } |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | $dependencies = []; |
| 132 | 132 | $class = new ReflectionClass($command); |
| 133 | 133 | foreach ($class->getConstructor()->getParameters() as $parameter) { |
| 134 | - if ( $parameter->getPosition() == 0 && $parameter->getType() && $parameter->getType()->getName() === 'array') { |
|
| 134 | + if ($parameter->getPosition() == 0 && $parameter->getType() && $parameter->getType()->getName() === 'array') { |
|
| 135 | 135 | if ($input !== []) { |
| 136 | 136 | $dependencies[] = $input; |
| 137 | 137 | } else { |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | private function getDefaultValueOrFail($parameter) |
| 160 | 160 | { |
| 161 | - if (! $parameter->isDefaultValueAvailable()) { |
|
| 161 | + if (!$parameter->isDefaultValueAvailable()) { |
|
| 162 | 162 | throw new InvalidArgumentException("Unable to map input to command {$this->inInputCommand} for parameter {$parameter->getName()}"); |
| 163 | 163 | } |
| 164 | 164 | |