This commit is contained in:
2020-09-07 18:11:36 +08:00
parent c5c716f6e5
commit 03ab3bb92f
10 changed files with 68 additions and 171 deletions
+5 -3
View File
@@ -5,6 +5,7 @@ namespace Console;
use Exception;
use Snowflake\Abstracts\Input;
use Snowflake\Snowflake;
use Swoole\Coroutine\Channel;
@@ -20,7 +21,7 @@ abstract class AbstractConsole
*/
public $commands = [];
/** @var Dtl $parameters */
/** @var Input $parameters */
private $parameters;
/** @var array */
@@ -47,10 +48,11 @@ abstract class AbstractConsole
/**
* @return $this
* @throws Exception
*/
public function setParameters()
{
$this->parameters = new Dtl($_SERVER['argv']);
$this->parameters = new Input($_SERVER['argv']);
return $this;
}
@@ -60,7 +62,7 @@ abstract class AbstractConsole
*/
public function execCommand(Command $command)
{
return $command->handler($this->parameters);
return $command->onHandler($this->parameters);
}
/**