Skip to content
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
3 changes: 1 addition & 2 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@
->withCache(directory: $cacheDirectory, namespace: $cacheNamespace)
->withFileExtensions(['php'])
->withSkip([])
->withPaths([])
->withRealPathReporting(false);
->withPaths([]);
8 changes: 6 additions & 2 deletions src/Config/ECSConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,14 @@ public function disableParallel(): void

/**
* @api
* @deprecated Real path reporting is deprecated. Use the JSON output format ("--output-format json"), which always reports absolute paths.
*/
public function reportingRealPath(bool $absolute = true): void
public function reportingRealPath(): void
{
SimpleParameterProvider::setParameter(Option::REPORTING_REALPATH, $absolute);
$outputPrinter = new OutputPrinter(new OutputColorizer());
$outputPrinter->warning(
'The "reportingRealPath()" method is deprecated. Use the JSON output format ("--output-format json") to get absolute paths.'
);
}

/**
Expand Down
4 changes: 1 addition & 3 deletions src/Configuration/ConfigurationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public function create(
$showDiffs = ! $noDiffs;

$isParallel = SimpleParameterProvider::getBoolParameter(Option::PARALLEL);
$isReportingWithRealPath = SimpleParameterProvider::getBoolParameter(Option::REPORTING_REALPATH);

return new Configuration(
$isFixer,
Expand All @@ -57,8 +56,7 @@ public function create(
$parallelPort,
$parallelIdentifier,
$memoryLimit,
$showDiffs,
$isReportingWithRealPath
$showDiffs
);
}

Expand Down
17 changes: 8 additions & 9 deletions src/Configuration/ECSConfigBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ final class ECSConfigBuilder

private int $parallelJobSize = 20;

private ?bool $reportingRealPath = null;

/**
* To make sure each common set and its corresponding level are not
* duplicated, as both contain the same rules.
Expand Down Expand Up @@ -159,10 +157,6 @@ public function __invoke(ECSConfig $ecsConfig): void
$ecsConfig->disableParallel();
}
}

if ($this->reportingRealPath !== null) {
$ecsConfig->reportingRealPath($this->reportingRealPath);
}
}

/**
Expand Down Expand Up @@ -428,10 +422,15 @@ public function withoutParallel(): self
return $this;
}

public function withRealPathReporting(bool $absolutePath = true): self
/**
* @deprecated Real path reporting is deprecated. Use the JSON output format ("--output-format json"), which always reports absolute paths.
*/
public function withRealPathReporting(): self
{
$this->reportingRealPath = $absolutePath;

$outputPrinter = new OutputPrinter(new OutputColorizer());
$outputPrinter->warning(
'The "withRealPathReporting()" method is deprecated. Use the JSON output format ("--output-format json") to get absolute paths.'
);
return $this;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Console/Output/CheckstyleOutputFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function report(ErrorAndDiffResult $errorAndDiffResult, Configuration $co
{
$checkstyleContent = $this->createCheckstyleContent(
$errorAndDiffResult,
$configuration->isReportingWithRealPath()
false
);
$this->easyCodingStandardStyle->writeln($checkstyleContent);

Expand Down
2 changes: 1 addition & 1 deletion src/Console/Output/ConsoleOutputFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(
public function report(ErrorAndDiffResult $errorAndDiffResult, Configuration $configuration): int
{
if ($configuration->shouldShowDiffs()) {
$this->reportFileDiffs($errorAndDiffResult->getFileDiffs(), $configuration->isReportingWithRealPath());
$this->reportFileDiffs($errorAndDiffResult->getFileDiffs());
}

$this->easyCodingStandardStyle->newLine(1);
Expand Down
6 changes: 3 additions & 3 deletions src/Console/Output/GitlabOutputFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,16 @@ public function generateReport(ErrorAndDiffResult $errorAndDiffResult, Configura
? merge(
$this->generateIssuesForErrors(
$errorAndDiffResult->getErrors(),
$configuration->isReportingWithRealPath()
false
),
$this->generateIssuesForFixes(
$errorAndDiffResult->getFileDiffs(),
$configuration->isReportingWithRealPath()
false
),
)
: $this->generateIssuesForErrors(
$errorAndDiffResult->getErrors(),
$configuration->isReportingWithRealPath()
false
);

return $this->encode($reportedQualityIssues);
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Output/JUnitOutputFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(
*/
public function report(ErrorAndDiffResult $errorAndDiffResult, Configuration $configuration): int
{
$xml = $this->createXmlOutput($errorAndDiffResult, $configuration->isReportingWithRealPath());
$xml = $this->createXmlOutput($errorAndDiffResult, false);
$this->easyCodingStandardStyle->writeln($xml);

return $this->exitCodeResolver->resolve($errorAndDiffResult, $configuration);
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Output/JsonOutputFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct(
*/
public function report(ErrorAndDiffResult $errorAndDiffResult, Configuration $configuration): int
{
$json = $this->createJsonContent($errorAndDiffResult, $configuration->isReportingWithRealPath());
$json = $this->createJsonContent($errorAndDiffResult, true);
$this->easyCodingStandardStyle->writeln($json);

return $this->exitCodeResolver->resolve($errorAndDiffResult, $configuration);
Expand Down
8 changes: 1 addition & 7 deletions src/ValueObject/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ public function __construct(
private string|null $parallelPort = null,
private string|null $parallelIdentifier = null,
private string|null $memoryLimit = null,
private bool $showDiffs = true,
private bool $reportingWithRealPath = false
private bool $showDiffs = true
) {
}

Expand Down Expand Up @@ -90,9 +89,4 @@ public function getMemoryLimit(): ?string
{
return $this->memoryLimit;
}

public function isReportingWithRealPath(): bool
{
return $this->reportingWithRealPath;
}
}
5 changes: 0 additions & 5 deletions src/ValueObject/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,4 @@ final class Option
* @see \Symplify\EasyCodingStandard\Config\ECSConfig::parallel()
*/
public const string PARALLEL_TIMEOUT_IN_SECONDS = 'parallel-timeout-in-seconds';

/**
* @see \Symplify\EasyCodingStandard\Config\ECSConfig::reportingRealPath()
*/
public const string REPORTING_REALPATH = 'reporting-realpath';
}
Loading