| @@ 31-65 (lines=35) @@ | ||
| 28 | * ?> |
|
| 29 | * ``` |
|
| 30 | */ |
|
| 31 | class DumpAutoload extends Base |
|
| 32 | { |
|
| 33 | /** |
|
| 34 | * {@inheritdoc} |
|
| 35 | */ |
|
| 36 | protected $action = 'dump-autoload'; |
|
| 37 | ||
| 38 | /** |
|
| 39 | * @var string |
|
| 40 | */ |
|
| 41 | protected $optimize; |
|
| 42 | ||
| 43 | /** |
|
| 44 | * @param bool $optimize |
|
| 45 | * |
|
| 46 | * @return $this |
|
| 47 | */ |
|
| 48 | public function optimize($optimize = true) |
|
| 49 | { |
|
| 50 | if ($optimize) { |
|
| 51 | $this->option("--optimize"); |
|
| 52 | } |
|
| 53 | return $this; |
|
| 54 | } |
|
| 55 | ||
| 56 | /** |
|
| 57 | * {@inheritdoc} |
|
| 58 | */ |
|
| 59 | public function run() |
|
| 60 | { |
|
| 61 | $command = $this->getCommand(); |
|
| 62 | $this->printTaskInfo('Dumping Autoloader: {command}', ['command' => $command]); |
|
| 63 | return $this->executeCommand($command); |
|
| 64 | } |
|
| 65 | } |
|
| 66 | ||
| @@ 25-54 (lines=30) @@ | ||
| 22 | * ?> |
|
| 23 | * ``` |
|
| 24 | */ |
|
| 25 | class Install extends Base |
|
| 26 | { |
|
| 27 | /** |
|
| 28 | * {@inheritdoc} |
|
| 29 | */ |
|
| 30 | protected $action = 'install'; |
|
| 31 | ||
| 32 | /** |
|
| 33 | * adds `no-suggest` option to composer |
|
| 34 | * |
|
| 35 | * @param bool $noSuggest |
|
| 36 | * |
|
| 37 | * @return $this |
|
| 38 | */ |
|
| 39 | public function noSuggest($noSuggest = true) |
|
| 40 | { |
|
| 41 | $this->option('--no-suggest'); |
|
| 42 | return $this; |
|
| 43 | } |
|
| 44 | ||
| 45 | /** |
|
| 46 | * {@inheritdoc} |
|
| 47 | */ |
|
| 48 | public function run() |
|
| 49 | { |
|
| 50 | $command = $this->getCommand(); |
|
| 51 | $this->printTaskInfo('Installing Packages: {command}', ['command' => $command]); |
|
| 52 | return $this->executeCommand($command); |
|
| 53 | } |
|
| 54 | } |
|
| 55 | ||
| @@ 25-54 (lines=30) @@ | ||
| 22 | * ?> |
|
| 23 | * ``` |
|
| 24 | */ |
|
| 25 | class Update extends Base |
|
| 26 | { |
|
| 27 | /** |
|
| 28 | * {@inheritdoc} |
|
| 29 | */ |
|
| 30 | protected $action = 'update'; |
|
| 31 | ||
| 32 | /** |
|
| 33 | * adds `no-suggest` option to composer |
|
| 34 | * |
|
| 35 | * @param bool $noSuggest |
|
| 36 | * |
|
| 37 | * @return $this |
|
| 38 | */ |
|
| 39 | public function noSuggest($noSuggest = true) |
|
| 40 | { |
|
| 41 | $this->option('--no-suggest'); |
|
| 42 | return $this; |
|
| 43 | } |
|
| 44 | ||
| 45 | /** |
|
| 46 | * {@inheritdoc} |
|
| 47 | */ |
|
| 48 | public function run() |
|
| 49 | { |
|
| 50 | $command = $this->getCommand(); |
|
| 51 | $this->printTaskInfo('Updating Packages: {command}', ['command' => $command]); |
|
| 52 | return $this->executeCommand($command); |
|
| 53 | } |
|
| 54 | } |
|
| 55 | ||