From 4827e6d47924967430b326221a6e119d05b7aa17 Mon Sep 17 00:00:00 2001 From: Ben Thomson Date: Fri, 4 Sep 2020 19:46:43 +0800 Subject: [PATCH] Make CheckboxList trait complete again --- src/Commands/InstallCheck/Command.php | 6 ------ src/Traits/CheckboxList.php | 25 ++++++++++++++++--------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/Commands/InstallCheck/Command.php b/src/Commands/InstallCheck/Command.php index 20e2151..fb10a9d 100644 --- a/src/Commands/InstallCheck/Command.php +++ b/src/Commands/InstallCheck/Command.php @@ -20,12 +20,6 @@ class Command extends BaseCommand */ protected static $defaultName = 'install:check'; - /** @var Symfony\Component\Console\Output\ConsoleSectionOutput Current section */ - protected $section = null; - - /** @var string Current section text */ - protected $sectionText = null; - /** @var bool If any checks have failed */ protected $failed = false; diff --git a/src/Traits/CheckboxList.php b/src/Traits/CheckboxList.php index 562dcde..d292040 100644 --- a/src/Traits/CheckboxList.php +++ b/src/Traits/CheckboxList.php @@ -1,12 +1,19 @@ section = $this->output->section(); - $this->sectionText = $text; - $this->section->writeln('[ ] ' . $text); + $this->checkbox = $this->output->section(); + $this->checkboxText = $text; + $this->checkbox->writeln('[ ] ' . $text); } protected function checkFailed() { - $this->section->overwrite('[X] ' . $this->sectionText); + $this->checkbox->overwrite('[X] ' . $this->checkboxText); if (func_num_args() > 0) { - $this->section->writeln(" " . implode("\n ", func_get_args()) . ''); + $this->checkbox->writeln(" " . implode("\n ", func_get_args()) . ''); } $this->failed = true; } protected function checkWarned() { - $this->section->overwrite('[W] ' . $this->sectionText); + $this->checkbox->overwrite('[W] ' . $this->checkboxText); if (func_num_args() > 0) { - $this->section->writeln(" " . implode("\n ", func_get_args()) . ''); + $this->checkbox->writeln(" " . implode("\n ", func_get_args()) . ''); } $this->warned = true; } protected function checkSuccessful() { - $this->section->overwrite('[] ' . $this->sectionText); + $this->checkbox->overwrite('[] ' . $this->checkboxText); if (func_num_args() > 0) { - $this->section->writeln(" " . implode("\n ", func_get_args()) . ''); + $this->checkbox->writeln(" " . implode("\n ", func_get_args()) . ''); } } }