Skip to content

Commit f71a0c0

Browse files
committed
Drop useless code
1 parent df090b9 commit f71a0c0

File tree

4 files changed

+3
-130
lines changed

4 files changed

+3
-130
lines changed

src/AnalyserResult.php

Lines changed: 0 additions & 96 deletions
This file was deleted.

src/AnalysisResult.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ class AnalysisResult
4747
/** @var bool */
4848
private $defaultLevelUsed;
4949

50-
/** @var string|null */
51-
private $projectConfigFile;
52-
5350
/** @var bool */
5451
private $savedResultCache;
5552

@@ -148,11 +145,6 @@ public function isDefaultLevelUsed(): bool
148145
return $this->defaultLevelUsed;
149146
}
150147

151-
public function getProjectConfigFile(): ?string
152-
{
153-
return $this->projectConfigFile;
154-
}
155-
156148
public function hasInternalErrors(): bool
157149
{
158150
return count($this->internalErrors) > 0;

src/ErrorFormatter/TableErrorFormatter.php

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,45 +40,23 @@ class TableErrorFormatter implements ErrorFormatter
4040
*/
4141
private $relativePathHelper;
4242

43-
/**
44-
* @var bool
45-
*/
46-
private $showTipsOfTheDay;
47-
4843
public function __construct(
49-
RelativePathHelper $relativePathHelper,
50-
bool $showTipsOfTheDay
44+
RelativePathHelper $relativePathHelper
5145
)
5246
{
5347
$this->relativePathHelper = $relativePathHelper;
54-
$this->showTipsOfTheDay = $showTipsOfTheDay;
5548
}
5649

5750
public function formatErrors(
5851
AnalysisResult $analysisResult,
5952
Output $output
6053
): int
6154
{
62-
$projectConfigFile = 'cli-tools.neon';
63-
if ($analysisResult->getProjectConfigFile() !== null) {
64-
$projectConfigFile = $this->relativePathHelper->getRelativePath($analysisResult->getProjectConfigFile());
65-
}
6655

6756
$style = $output->getStyle();
6857

6958
if (!$analysisResult->hasErrors() && !$analysisResult->hasWarnings()) {
7059
$style->success('No errors');
71-
if ($this->showTipsOfTheDay) {
72-
if ($analysisResult->isDefaultLevelUsed()) {
73-
$output->writeLineFormatted('💡 Tip of the Day:');
74-
$output->writeLineFormatted(sprintf(
75-
"cli-tools is performing only the most basic checks.\nYou can pass a higher rule level through the <fg=cyan>--%s</> option\n(the default and current level is %d) to analyse code more thoroughly.",
76-
AnalyseCommand::OPTION_LEVEL,
77-
AnalyseCommand::DEFAULT_LEVEL
78-
));
79-
$output->writeLineFormatted('');
80-
}
81-
}
8260

8361
return 0;
8462
}
@@ -99,7 +77,6 @@ public function formatErrors(
9977
$message = $error->getMessage();
10078
if ($error->getTip() !== null) {
10179
$tip = $error->getTip();
102-
$tip = str_replace('%configurationFile%', $projectConfigFile, $tip);
10380
$message .= "\n💡 " . $tip;
10481
}
10582
$rows[] = [

src/ErrorFormatter/TeamcityErrorFormatter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output): in
8383
'typeId' => 'cli-tools',
8484
'message' => $notFileSpecificError,
8585
// the file is required
86-
'file' => $analysisResult->getProjectConfigFile() !== null ? $this->relativePathHelper->getRelativePath($analysisResult->getProjectConfigFile()) : '.',
86+
'file' => '.',
8787
'SEVERITY' => 'ERROR',
8888
]);
8989
}
@@ -93,7 +93,7 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output): in
9393
'typeId' => 'cli-tools',
9494
'message' => $warning,
9595
// the file is required
96-
'file' => $analysisResult->getProjectConfigFile() !== null ? $this->relativePathHelper->getRelativePath($analysisResult->getProjectConfigFile()) : '.',
96+
'file' => '.',
9797
'SEVERITY' => 'WARNING',
9898
]);
9999
}

0 commit comments

Comments
 (0)