Skip to content

Commit 40a18a5

Browse files
committed
update some for built in command
1 parent c92753c commit 40a18a5

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

src/BuiltIn/SelfUpdateCommand.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ class SelfUpdateCommand extends Command
4646
/**
4747
* Execute the command.
4848
*
49+
* @options
50+
* --check bool;check
51+
* --rollback bool;Rollback to prev version
52+
*
4953
* @param Input $input
5054
* @param Output $output
5155
*/
@@ -57,13 +61,13 @@ protected function execute(Input $input, Output $output)
5761
/**
5862
* Check for ancilliary options
5963
*/
60-
if ($input->getOption('rollback')) {
64+
if ($this->flags->getOpt('rollback')) {
6165
$this->rollback();
6266

6367
return;
6468
}
6569

66-
if ($input->getOption('check')) {
70+
if ($this->flags->getOpt('check')) {
6771
$this->printAvailableUpdates();
6872

6973
return;
@@ -72,25 +76,25 @@ protected function execute(Input $input, Output $output)
7276
/**
7377
* Update to any specified stability option
7478
*/
75-
if ($input->getOption('dev')) {
79+
if ($this->flags->getOpt('dev')) {
7680
$this->updateToDevelopmentBuild();
7781

7882
return;
7983
}
8084

81-
if ($input->getOption('pre')) {
85+
if ($this->flags->getOpt('pre')) {
8286
$this->updateToPreReleaseBuild();
8387

8488
return;
8589
}
8690

87-
if ($input->getOption('stable')) {
91+
if ($this->flags->getOpt('stable')) {
8892
$this->updateToStableBuild();
8993

9094
return;
9195
}
9296

93-
if ($input->getOption('non-dev')) {
97+
if ($this->flags->getOpt('non-dev')) {
9498
$this->updateToMostRecentNonDevRemote();
9599

96100
return;

src/Concern/SubCommandsWareTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ protected function dispatchCommand(string $name): void
8383
*
8484
* @throws InvalidArgumentException
8585
*/
86-
public function addCommand(string $name, $handler = null, array $options = []): void
86+
public function addSub(string $name, $handler = null, array $options = []): void
8787
{
8888
if (!$handler && class_exists($name)) {
8989
/** @var Command $name name is an command class */
@@ -151,9 +151,9 @@ public function addCommands(array $commands): void
151151
{
152152
foreach ($commands as $name => $handler) {
153153
if (is_int($name)) {
154-
$this->addCommand($handler);
154+
$this->addSub($handler);
155155
} else {
156-
$this->addCommand($name, $handler);
156+
$this->addSub($name, $handler);
157157
}
158158
}
159159
}

0 commit comments

Comments
 (0)