diff --git a/app/Console/Commands/IdentifyIssues.php b/app/Console/Commands/IdentifyIssues.php index 17f0d756..8ed7207d 100644 --- a/app/Console/Commands/IdentifyIssues.php +++ b/app/Console/Commands/IdentifyIssues.php @@ -6,6 +6,7 @@ use App\Issues\Types\ICanFixThem; use App\Issues\Types\IssueBase; use Illuminate\Console\Command; +use Illuminate\Console\Concerns\InteractsWithIO; use Illuminate\Support\Str; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -50,7 +51,9 @@ public function handle(): void /** @var IssueBase $firstIssue */ $firstIssue = $myIssues->first(); $issueTitle = $firstIssue->getIssueTitle(); - $canFixThisIssueType = array_key_exists(ICanFixThem::class, (new \ReflectionClass($firstIssue))->getTraits()); + $issueTraits = (new \ReflectionClass($firstIssue))->getTraits(); + $canFixThisIssueType = array_key_exists(ICanFixThem::class, $issueTraits); + $needsOutputSet = array_key_exists(InteractsWithIO::class, $issueTraits); $this->info(sprintf('%d: %s (%d)', $issueNumber, $issueTitle, count($myIssues))); $this->info("URL: {$firstIssue->getIssueURL()}"); @@ -62,7 +65,9 @@ public function handle(): void $this->info("\t{$issue->getIssueText()}"); if ($canFixThisIssueType) { /** @var ICanFixThem|IssueBase $issue */ - $issue->setOutput($this->output); + if($needsOutputSet) { + $issue->setOutput($this->output); + } $fixableIssues->add($issue); } } @@ -85,7 +90,6 @@ public function handle(): void foreach ($fixableIssues as $issue) { /** @var IssueBase|ICanFixThem $issue */ $this->info(sprintf('%d: %s', $issue::getIssueNumber(), $issue->getIssueText())); - $issue->setOutput($this->output); try { if ($issue->fix()) { $numIssuesFixed++; diff --git a/app/DataCache/CachedData.php b/app/DataCache/CachedData.php index fa0b4840..97ecb18e 100644 --- a/app/DataCache/CachedData.php +++ b/app/DataCache/CachedData.php @@ -5,7 +5,6 @@ use App\External\HasApiProgressBar; use Illuminate\Contracts\Container\Container; use Illuminate\Support\Collection; -use Symfony\Component\Console\Output\OutputInterface; /** * Inherit from this class to automatically scope your instance to the current request lifecycle. It also provides an diff --git a/app/DataCache/GoogleGroupMembers.php b/app/DataCache/GoogleGroupMembers.php index 37bf873d..c3579c44 100644 --- a/app/DataCache/GoogleGroupMembers.php +++ b/app/DataCache/GoogleGroupMembers.php @@ -14,7 +14,7 @@ public function __construct( } public function get($groupName) { - return $this->cache(function () use ($groupName) { + return $this->cache($groupName, function () use ($groupName) { return $this->googleApi->group($groupName) ->list($this->apiProgress("Fetching Google Group Members $groupName")); }); diff --git a/app/Issues/IssueChecker.php b/app/Issues/IssueChecker.php index 75b18f5f..9f7ef6d9 100644 --- a/app/Issues/IssueChecker.php +++ b/app/Issues/IssueChecker.php @@ -35,7 +35,7 @@ public function getIssues(): Collection $this->issues = collect(); foreach ($this->getIssueCheckers() as $checker) { - if (! app()->resolved(OutputInterface::class)) { + if (app()->resolved(OutputInterface::class)) { $output = app(OutputInterface::class); $shortName = Str::replace('App\\Issues\\Checkers\\', '', get_class($checker)); $output->writeln("Getting issues for: $shortName");