Skip to content

Adjust interpolation #632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}");
}
}