Skip to content

Commit

Permalink
Remove repeated calls to EasyCodingStandardStyle->isDebug() (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Apr 19, 2024
1 parent edbb408 commit 58daa82
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/FixerRunner/Application/FixerFileProcessor.php
Expand Up @@ -31,6 +31,8 @@ final class FixerFileProcessor implements FileProcessorInterface
*/
private array $fixers = [];

private readonly bool $isDebug;

/**
* @param FixerInterface[] $fixers
*/
Expand All @@ -44,6 +46,7 @@ public function __construct(
array $fixers
) {
$this->fixers = $this->sortFixers($fixers);
$this->isDebug = $easyCodingStandardStyle->isDebug();
}

/**
Expand Down Expand Up @@ -148,7 +151,7 @@ private function processTokensByFixer(string $filePath, Tokens $tokens, FixerInt
}

// show current fixer in --debug / -vvv
if ($this->easyCodingStandardStyle->isDebug()) {
if ($this->isDebug) {
$this->easyCodingStandardStyle->writeln(' [fixer] ' . $fixer::class);
}

Expand Down

0 comments on commit 58daa82

Please sign in to comment.