mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-09 08:02:48 +08:00
代码规范化
This commit is contained in:
@@ -362,7 +362,6 @@ class Command
|
||||
return $this->help;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 描述信息
|
||||
* @return string
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
|
||||
namespace think\console;
|
||||
|
||||
use think\console\input\Definition;
|
||||
use think\console\input\Argument;
|
||||
use think\console\input\Definition;
|
||||
use think\console\input\Option;
|
||||
|
||||
class Input
|
||||
@@ -38,7 +38,6 @@ class Input
|
||||
private $tokens;
|
||||
private $parsed;
|
||||
|
||||
|
||||
public function __construct($argv = null)
|
||||
{
|
||||
if (null === $argv) {
|
||||
@@ -52,7 +51,6 @@ class Input
|
||||
$this->definition = new Definition();
|
||||
}
|
||||
|
||||
|
||||
protected function setTokens(array $tokens)
|
||||
{
|
||||
$this->tokens = $tokens;
|
||||
@@ -71,7 +69,6 @@ class Input
|
||||
$this->parse();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 解析参数
|
||||
*/
|
||||
@@ -94,7 +91,6 @@ class Input
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 解析短选项
|
||||
* @param string $token 当前的指令.
|
||||
@@ -178,7 +174,6 @@ class Input
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加一个短选项的值
|
||||
* @param string $shortcut 短名称
|
||||
@@ -260,7 +255,6 @@ class Input
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 检查原始参数是否包含某个值
|
||||
* @param string|array $values 需要检查的值
|
||||
@@ -309,7 +303,6 @@ class Input
|
||||
return $default;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 验证输入
|
||||
* @throws \RuntimeException
|
||||
@@ -459,7 +452,7 @@ class Input
|
||||
return $match[1] . $this->escapeToken($match[2]);
|
||||
}
|
||||
|
||||
if ($token && $token[0] !== '-') {
|
||||
if ($token && '-' !== $token[0]) {
|
||||
return $this->escapeToken($token);
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ class Output
|
||||
{
|
||||
$descriptor = new Descriptor();
|
||||
$options = array_merge([
|
||||
'raw_text' => false
|
||||
'raw_text' => false,
|
||||
], $options);
|
||||
|
||||
$descriptor->describe($this, $object, $options);
|
||||
|
||||
@@ -27,7 +27,7 @@ class Build extends Command
|
||||
$this->setName('build')
|
||||
->setDefinition([
|
||||
new Option('config', null, Option::VALUE_OPTIONAL, "build.php path"),
|
||||
new Option('module', null, Option::VALUE_OPTIONAL, "module name")
|
||||
new Option('module', null, Option::VALUE_OPTIONAL, "module name"),
|
||||
])
|
||||
->setDescription('Build Application Dirs');
|
||||
}
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
|
||||
namespace think\console\output;
|
||||
|
||||
use think\console\Output;
|
||||
use think\console\input\Argument as InputArgument;
|
||||
use think\console\input\Option as InputOption;
|
||||
use think\console\input\Definition as InputDefinition;
|
||||
use think\console\Command;
|
||||
use think\Console;
|
||||
use think\console\Command;
|
||||
use think\console\input\Argument as InputArgument;
|
||||
use think\console\input\Definition as InputDefinition;
|
||||
use think\console\input\Option as InputOption;
|
||||
use think\console\Output;
|
||||
use think\console\output\descriptor\Console as ConsoleDescription;
|
||||
|
||||
class Descriptor
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace think\console\output;
|
||||
|
||||
use think\console\output\formatter\Style;
|
||||
use think\console\output\formatter\Stack as StyleStack;
|
||||
use think\console\output\formatter\Style;
|
||||
|
||||
class Formatter
|
||||
{
|
||||
|
||||
@@ -11,9 +11,8 @@
|
||||
|
||||
namespace think\console\output\descriptor;
|
||||
|
||||
|
||||
use think\console\Command;
|
||||
use think\Console as ThinkConsole;
|
||||
use think\console\Command;
|
||||
|
||||
class Console
|
||||
{
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
namespace think\console\output\driver;
|
||||
|
||||
|
||||
use think\console\Output;
|
||||
|
||||
class Buffer
|
||||
|
||||
@@ -28,7 +28,6 @@ class Console
|
||||
/** @var Output */
|
||||
private $output;
|
||||
|
||||
|
||||
public function __construct(Output $output)
|
||||
{
|
||||
$this->output = $output;
|
||||
@@ -132,7 +131,6 @@ class Console
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取终端宽度
|
||||
* @return int|null
|
||||
@@ -307,7 +305,6 @@ class Console
|
||||
return false === $this->isRunningOS400();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return resource
|
||||
*/
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
namespace think\console\helper\question;
|
||||
|
||||
|
||||
class Choice extends Question
|
||||
{
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
namespace think\console\helper\question;
|
||||
|
||||
|
||||
class Confirmation extends Question
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user