Skip to content

Commit be5c947

Browse files
Merged master
1 parent bdb02e4 commit be5c947

23 files changed

+36
-63
lines changed

src/Business/Churn/Report/ReportGeneratorInterface.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
namespace Phauthentic\CognitiveCodeAnalysis\Business\Churn\Report;
66

7-
/**
8-
*
9-
*/
107
interface ReportGeneratorInterface
118
{
129
/**

src/Business/Cognitive/Report/CsvReport.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
use Phauthentic\CognitiveCodeAnalysis\Business\Cognitive\CognitiveMetricsCollection;
88
use Phauthentic\CognitiveCodeAnalysis\CognitiveAnalysisException;
99

10-
/**
11-
*
12-
*/
1310
class CsvReport implements ReportGeneratorInterface
1411
{
1512
/**

src/Business/Cognitive/Report/JsonReport.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
use Phauthentic\CognitiveCodeAnalysis\Business\Cognitive\CognitiveMetricsCollection;
88
use Phauthentic\CognitiveCodeAnalysis\CognitiveAnalysisException;
99

10-
/**
11-
*
12-
*/
1310
class JsonReport implements ReportGeneratorInterface
1411
{
1512
/**

src/Business/Cognitive/Report/ReportGeneratorInterface.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
use Phauthentic\CognitiveCodeAnalysis\Business\Cognitive\CognitiveMetricsCollection;
88

9-
/**
10-
*
11-
*/
129
interface ReportGeneratorInterface
1310
{
1411
public function export(CognitiveMetricsCollection $metrics, string $filename): void;

src/Command/CognitiveMetricsCommand.php

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,21 @@ protected function execute(InputInterface $input, OutputInterface $output): int
185185
* @param CognitiveMetricsCollection $metricsCollection
186186
* @throws Exception
187187
*/
188-
private function handleBaseLine(CognitiveMetricsCommandContext $context, CognitiveMetricsCollection $metricsCollection): void
189-
{
190-
if ($context->hasBaselineFile()) {
191-
$baselineFile = $context->getBaselineFile();
192-
if ($baselineFile !== null) {
193-
$baseline = $this->baselineService->loadBaseline($baselineFile);
194-
$this->baselineService->calculateDeltas($metricsCollection, $baseline);
195-
}
188+
private function handleBaseLine(
189+
CognitiveMetricsCommandContext $context,
190+
CognitiveMetricsCollection $metricsCollection
191+
): void {
192+
if (!$context->hasBaselineFile()) {
193+
return;
196194
}
195+
196+
$baselineFile = $context->getBaselineFile();
197+
if ($baselineFile === null) {
198+
return;
199+
}
200+
201+
$baseline = $this->baselineService->loadBaseline($baselineFile);
202+
$this->baselineService->calculateDeltas($metricsCollection, $baseline);
197203
}
198204

199205
/**

src/Command/CognitiveMetricsSpecifications/CompositeCognitiveMetricsValidationSpecification.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ public function getErrorMessage(): string
3232
return 'Validation failed';
3333
}
3434

35-
public function getFirstFailedSpecification(CognitiveMetricsCommandContext $context): ?CognitiveMetricsCommandValidationSpecification
36-
{
35+
public function getFirstFailedSpecification(
36+
CognitiveMetricsCommandContext $context
37+
): ?CognitiveMetricsCommandValidationSpecification {
3738
foreach ($this->specifications as $specification) {
3839
if (!$specification->isSatisfiedBy($context)) {
3940
return $specification;

src/Command/CognitiveMetricsSpecifications/SortFieldValidSpecification.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
namespace Phauthentic\CognitiveCodeAnalysis\Command\CognitiveMetricsSpecifications;
66

7-
use Phauthentic\CognitiveCodeAnalysis\Business\Cognitive\CognitiveMetricsSorter;
8-
97
class SortFieldValidSpecification implements CognitiveMetricsCommandValidationSpecification
108
{
119
private const SORTABLE_FIELDS = [

src/Config/ConfigLoader.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Phauthentic\CognitiveCodeAnalysis\Config;
66

77
use Phauthentic\CognitiveCodeAnalysis\Business\Cognitive\MetricNames;
8-
use PhpBench\Benchmark\Metadata\Annotations\Subject;
98
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
109
use Symfony\Component\Config\Definition\ConfigurationInterface;
1110

tests/Command/ChurnSpecifications/ChurnSpecificationPatternTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Phauthentic\CognitiveCodeAnalysis\Tests\Command\ChurnSpecifications;
66

7-
use Phauthentic\CognitiveCodeAnalysis\Command\ChurnCommand;
87
use Phauthentic\CognitiveCodeAnalysis\Command\ChurnSpecifications\ChurnCommandContext;
98
use Phauthentic\CognitiveCodeAnalysis\Command\ChurnSpecifications\CoverageFormatExclusivitySpecification;
109
use Phauthentic\CognitiveCodeAnalysis\Command\ChurnSpecifications\CoverageFileExistsSpecification;

tests/Command/CognitiveMetricsSpecifications/CognitiveMetricsSpecificationPatternTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Phauthentic\CognitiveCodeAnalysis\Tests\Command\CognitiveMetricsSpecifications;
66

7-
use Phauthentic\CognitiveCodeAnalysis\Command\CognitiveMetricsCommand;
87
use Phauthentic\CognitiveCodeAnalysis\Command\CognitiveMetricsSpecifications\CognitiveMetricsCommandContext;
98
use Phauthentic\CognitiveCodeAnalysis\Command\CognitiveMetricsSpecifications\CoverageFormatExclusivitySpecification;
109
use Phauthentic\CognitiveCodeAnalysis\Command\CognitiveMetricsSpecifications\CoverageFileExistsSpecification;

0 commit comments

Comments
 (0)