feat: 同步下新环境

This commit is contained in:
笔记本里的永平
2025-07-07 11:31:25 +08:00
parent 3d1050db3d
commit 86c261ba70
196 changed files with 13146 additions and 29319 deletions

View File

@@ -69,7 +69,7 @@ class Descriptor
* 描述参数
* @param InputArgument $argument
* @param array $options
* @return string|mixed
* @return void
*/
protected function describeInputArgument(InputArgument $argument, array $options = [])
{
@@ -93,7 +93,7 @@ class Descriptor
* 描述选项
* @param InputOption $option
* @param array $options
* @return string|mixed
* @return void
*/
protected function describeInputOption(InputOption $option, array $options = [])
{
@@ -128,7 +128,7 @@ class Descriptor
* 描述输入
* @param InputDefinition $definition
* @param array $options
* @return string|mixed
* @return void
*/
protected function describeInputDefinition(InputDefinition $definition, array $options = [])
{
@@ -173,7 +173,7 @@ class Descriptor
* 描述指令
* @param Command $command
* @param array $options
* @return string|mixed
* @return void
*/
protected function describeCommand(Command $command, array $options = [])
{
@@ -208,7 +208,7 @@ class Descriptor
* 描述控制台
* @param Console $console
* @param array $options
* @return string|mixed
* @return void
*/
protected function describeConsole(Console $console, array $options = [])
{

View File

@@ -104,10 +104,6 @@ class Console
/** @var Command $command */
foreach ($commands as $name => $command) {
if (is_string($command)) {
$command = new $command();
}
if (!$command->getName()) {
continue;
}

View File

@@ -37,6 +37,11 @@ class Console
$this->formatter->setDecorated($decorated);
}
public function getFormatter()
{
return $this->formatter;
}
public function setDecorated($decorated)
{
$this->formatter->setDecorated($decorated);
@@ -168,7 +173,7 @@ class Console
return $this->terminalDimensions;
}
if ('\\' === DIRECTORY_SEPARATOR) {
if ('\\' === DS) {
if (preg_match('/^(\d+)x\d+ \(\d+x(\d+)\)$/', trim(getenv('ANSICON')), $matches)) {
return [(int) $matches[1], (int) $matches[2]];
}

View File

@@ -147,7 +147,7 @@ class Choice extends Question
$result = $value;
}
if (false === $result) {
if (empty($result)) {
throw new \InvalidArgumentException(sprintf($errorMessage, $value));
}
array_push($multiselectChoices, $result);