diff --git a/library/think/Console.php b/library/think/Console.php index 79ddb8a1..c7f8465e 100644 --- a/library/think/Console.php +++ b/library/think/Console.php @@ -361,7 +361,7 @@ class Console /** * 某个指令是否存在 - * @param string $name 指令民初 + * @param string $name 指令名称 * @return bool */ public function has($name) @@ -517,16 +517,6 @@ class Console return $abbrevs; } - /** - * 呈现捕获的异常 - * @param \Exception $e - * @param Stream $output - */ - public function renderException(\Exception $e, Stream $output) - { - - } - /** * 配置基于用户的参数和选项的输入和输出实例。 @@ -543,11 +533,6 @@ class Console if (true === $input->hasParameterOption(['--no-interaction', '-n'])) { $input->setInteractive(false); - } elseif (function_exists('posix_isatty') && $this->getHelperSet()->has('question')) { - $inputStream = $this->getHelperSet()->get('question')->getInputStream(); - if (!@posix_isatty($inputStream) && false === getenv('SHELL_INTERACTIVE')) { - $input->setInteractive(false); - } } if (true === $input->hasParameterOption(['--quiet', '-q'])) { diff --git a/library/think/console/Output.php b/library/think/console/Output.php index c4983c79..62296cea 100644 --- a/library/think/console/Output.php +++ b/library/think/console/Output.php @@ -17,6 +17,16 @@ use think\console\output\driver\Buffer; use think\console\output\driver\Console; use think\console\output\driver\Nothing; +/** + * Class Output + * @package think\console + * + * @see think\console\output\driver\Console::setDecorated + * @method void setDecorated($decorated) + * + * @see think\console\output\driver\Buffer::fetch + * @method string fetch() + */ class Output { const VERBOSITY_QUIET = 0; diff --git a/library/think/console/output/Formatter.php b/library/think/console/output/Formatter.php index 2266457c..f8bee552 100644 --- a/library/think/console/output/Formatter.php +++ b/library/think/console/output/Formatter.php @@ -47,7 +47,7 @@ class Formatter /** * 设置外观标识 - * @param bool $decorated 是否美化文职 + * @param bool $decorated 是否美化文字 */ public function setDecorated($decorated) { diff --git a/library/think/console/output/driver/Console.php b/library/think/console/output/driver/Console.php index 84226ac9..3b8f3c7e 100644 --- a/library/think/console/output/driver/Console.php +++ b/library/think/console/output/driver/Console.php @@ -37,6 +37,11 @@ class Console $this->formatter->setDecorated($decorated); } + public function setDecorated($decorated) + { + $this->formatter->setDecorated($decorated); + } + public function write($messages, $newline = false, $type = Output::OUTPUT_NORMAL, $stream = null) { if (Output::VERBOSITY_QUIET === $this->output->getVerbosity()) {