mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 07:12:47 +08:00
代码规范化
This commit is contained in:
@@ -11,7 +11,6 @@
|
||||
|
||||
namespace think\console\helper\question;
|
||||
|
||||
|
||||
class Choice extends Question
|
||||
{
|
||||
|
||||
@@ -154,4 +153,4 @@ class Choice extends Question
|
||||
return current($multiselectChoices);
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
namespace think\console\helper\question;
|
||||
|
||||
|
||||
class Confirmation extends Question
|
||||
{
|
||||
|
||||
@@ -25,7 +24,7 @@ class Confirmation extends Question
|
||||
*/
|
||||
public function __construct($question, $default = true, $trueAnswerRegex = '/^y/i')
|
||||
{
|
||||
parent::__construct($question, (bool)$default);
|
||||
parent::__construct($question, (bool) $default);
|
||||
|
||||
$this->trueAnswerRegex = $trueAnswerRegex;
|
||||
$this->setNormalizer($this->getDefaultNormalizer());
|
||||
@@ -45,7 +44,7 @@ class Confirmation extends Question
|
||||
return $answer;
|
||||
}
|
||||
|
||||
$answerIsTrue = (bool)preg_match($regex, $answer);
|
||||
$answerIsTrue = (bool) preg_match($regex, $answer);
|
||||
if (false === $default) {
|
||||
return $answer && $answerIsTrue;
|
||||
}
|
||||
@@ -53,4 +52,4 @@ class Confirmation extends Question
|
||||
return !$answer || $answerIsTrue;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ class Question
|
||||
throw new \LogicException('A hidden question cannot use the autocompleter.');
|
||||
}
|
||||
|
||||
$this->hidden = (bool)$hidden;
|
||||
$this->hidden = (bool) $hidden;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -93,7 +93,7 @@ class Question
|
||||
*/
|
||||
public function setHiddenFallback($fallback)
|
||||
{
|
||||
$this->hiddenFallback = (bool)$fallback;
|
||||
$this->hiddenFallback = (bool) $fallback;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -206,6 +206,6 @@ class Question
|
||||
|
||||
protected function isAssoc($array)
|
||||
{
|
||||
return (bool)count(array_filter(array_keys($array), 'is_string'));
|
||||
return (bool) count(array_filter(array_keys($array), 'is_string'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user