改名
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Snowflake\Abstracts;
|
||||
|
||||
|
||||
interface Kernel
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getCommands(): array;
|
||||
|
||||
}
|
||||
@@ -19,6 +19,7 @@ use Queue\QueueProviders;
|
||||
use Snowflake\Abstracts\BaseApplication;
|
||||
use Snowflake\Abstracts\Config;
|
||||
use Snowflake\Abstracts\Input;
|
||||
use Snowflake\Abstracts\Kernel;
|
||||
use Snowflake\Exception\NotFindClassException;
|
||||
use Snowflake\Exception\ConfigException;
|
||||
use Swoole\Coroutine;
|
||||
@@ -73,6 +74,19 @@ class Application extends BaseApplication
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $kernel
|
||||
* @return $this
|
||||
*/
|
||||
public function commands(Kernel $kernel)
|
||||
{
|
||||
foreach ($kernel->getCommands() as $command) {
|
||||
$this->register($command);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $command
|
||||
* @throws
|
||||
|
||||
Reference in New Issue
Block a user