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