代码规范化

This commit is contained in:
thinkphp
2016-08-09 10:35:06 +08:00
parent 8b147f6895
commit 131aaf1357
18 changed files with 60 additions and 75 deletions

View File

@@ -11,7 +11,6 @@
namespace think\console\helper\question;
class Choice extends Question
{
@@ -154,4 +153,4 @@ class Choice extends Question
return current($multiselectChoices);
};
}
}
}

View File

@@ -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;
};
}
}
}

View File

@@ -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'));
}
}
}