Skip to content

Commit

Permalink
add braces in correct spots (#632)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmgmyr authored Mar 18, 2023
1 parent f5c7f6b commit 5bf3b17
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/Application/Console/Formatters/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function formatFix(InsightCollection $insightCollection, array $metrics):
if ($insight->getTotalFix() === 0) {
continue;
}
$fix = "<fg=green>• [$category] </><bold>{$insight->getTitle()}</bold>:";
$fix = "<fg=green>• [{$category}] </><bold>{$insight->getTitle()}</bold>:";

$details = $insight->getFixPerFile();
/** @var Details $detail */
Expand Down Expand Up @@ -380,7 +380,7 @@ private function issues(InsightCollection $insightCollection, array $metrics, st

$previousCategory = $category;

$issue = "\n<fg=red>•</> [$category] <bold>{$insight->getTitle()}</bold>";
$issue = "\n<fg=red>•</> [{$category}] <bold>{$insight->getTitle()}</bold>";

if (! $insight instanceof HasDetails && ! $this->style->getOutput()->isVerbose()) {
$this->style->writeln($issue);
Expand Down Expand Up @@ -419,7 +419,7 @@ private function issues(InsightCollection $insightCollection, array $metrics, st
$detailString .= ($detailString !== '' ? ': ' : '') . $this->parseDetailMessage($detail);
}

$issue .= "\n $detailString";
$issue .= "\n {$detailString}";
}

if (! $this->style->getOutput()->isVerbose() && $totalDetails > 3) {
Expand Down
2 changes: 1 addition & 1 deletion src/Domain/Insights/CyclomaticComplexityIsHigh.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function process(): void

$this->details = array_map(static fn ($class, $complexity): Details => Details::make()
->setFile($class)
->setMessage("$complexity cyclomatic complexity"), array_keys($classesComplexity), $classesComplexity);
->setMessage("{$complexity} cyclomatic complexity"), array_keys($classesComplexity), $classesComplexity);
}

private function getMaxComplexity(): int
Expand Down
2 changes: 1 addition & 1 deletion src/Domain/Insights/ForbiddenGlobals.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function getDetails(): array
}

$details[] = Details::make()->setFile($file)->setMessage(
"Usage of $global found; Usage of GLOBALS are discouraged consider not relying on global scope"
"Usage of {$global} found; Usage of GLOBALS are discouraged consider not relying on global scope"
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Domain/Insights/ForbiddenSecurityIssues.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private function addIssuesDetails(string $packageName, string $version, array $i
continue;
}
self::$details[] = Details::make()->setMessage(
"$packageName@$version {$issue['title']} - {$issue['link']}"
"{$packageName}@{$version} {$issue['title']} - {$issue['link']}"
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Domain/Results.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,6 @@ private function getInsightByCategory(string $insightClass, string $category): I
}
}

throw new InsightClassNotFound("$insightClass not found in $category");
throw new InsightClassNotFound("{$insightClass} not found in {$category}");
}
}

0 comments on commit 5bf3b17

Please sign in to comment.