Skip to content

Commit 6d91ae4

Browse files
committed
Code cleanup.
Unused use statement removed.
1 parent 6e7e092 commit 6d91ae4

25 files changed

+59
-83
lines changed

src/PHPSemVerChecker/Analyzer/Analyzer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
use PHPSemVerChecker\Registry\Registry;
66
use PHPSemVerChecker\Report\Report;
77

8-
class Analyzer
9-
{
8+
class Analyzer {
109
/**
1110
* Compare with a destination registry (what the new source code is like).
1211
*

src/PHPSemVerChecker/Analyzer/ClassAnalyzer.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66
use PHPSemVerChecker\Operation\ClassRemoved;
77
use PHPSemVerChecker\Registry\Registry;
88
use PHPSemVerChecker\Report\Report;
9-
use PHPSemVerChecker\SemanticVersioning\Level;
109

11-
class ClassAnalyzer
12-
{
10+
class ClassAnalyzer {
1311
protected $context = 'class';
1412

1513
public function analyze(Registry $registryBefore, Registry $registryAfter)

src/PHPSemVerChecker/Analyzer/ClassMethodAnalyzer.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,21 @@
33
namespace PHPSemVerChecker\Analyzer;
44

55
use PhpParser\Node\Stmt;
6-
use PhpParser\Node\Stmt\Class_;
7-
use PhpParser\Node\Stmt\ClassMethod;
86
use PHPSemVerChecker\Comparator\Signature;
97
use PHPSemVerChecker\Operation\ClassMethodAdded;
108
use PHPSemVerChecker\Operation\ClassMethodImplementationChanged;
119
use PHPSemVerChecker\Operation\ClassMethodParameterChanged;
1210
use PHPSemVerChecker\Operation\ClassMethodParameterNameChanged;
1311
use PHPSemVerChecker\Operation\ClassMethodRemoved;
1412
use PHPSemVerChecker\Report\Report;
15-
use PHPSemVerChecker\SemanticVersioning\Level;
1613

17-
class ClassMethodAnalyzer
18-
{
14+
class ClassMethodAnalyzer {
1915
protected $context;
2016
protected $fileBefore;
2117
protected $fileAfter;
2218

2319
/**
20+
* @param string $context
2421
* @param string $fileBefore
2522
* @param string $fileAfter
2623
*/
@@ -33,7 +30,6 @@ public function __construct($context, $fileBefore = null, $fileAfter = null)
3330

3431
public function analyze(Stmt $contextBefore, Stmt $contextAfter)
3532
{
36-
// TODO: Verify that the given contexts match the context given in the constructor <[email protected]>
3733
$report = new Report();
3834

3935
$methodsBefore = $contextBefore->getMethods();

src/PHPSemVerChecker/Analyzer/FunctionAnalyzer.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
use PHPSemVerChecker\Report\Report;
1414
use PHPSemVerChecker\SemanticVersioning\Level;
1515

16-
class FunctionAnalyzer
17-
{
16+
class FunctionAnalyzer {
1817
protected $context = 'function';
1918

2019
/**
@@ -42,7 +41,6 @@ public function analyze(Registry $registryBefore, Registry $registryAfter)
4241

4342
foreach ($toVerify as $key) {
4443
$fileBefore = $registryBefore->mapping['function'][$key];
45-
/** @var Function_ $functionBefore */
4644
$functionBefore = $registryBefore->data['function'][$key];
4745
$fileAfter = $registryAfter->mapping['function'][$key];
4846
$functionAfter = $registryAfter->data['function'][$key];

src/PHPSemVerChecker/Analyzer/InterfaceAnalyzer.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66
use PHPSemVerChecker\Operation\InterfaceRemoved;
77
use PHPSemVerChecker\Registry\Registry;
88
use PHPSemVerChecker\Report\Report;
9-
use PHPSemVerChecker\SemanticVersioning\Level;
109

11-
class InterfaceAnalyzer
12-
{
10+
class InterfaceAnalyzer {
1311
protected $context = 'interface';
1412

1513
public function analyze(Registry $registryBefore, Registry $registryAfter)

src/PHPSemVerChecker/Analyzer/PropertyAnalyzer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
use PHPSemVerChecker\Operation\PropertyRemoved;
99
use PHPSemVerChecker\Report\Report;
1010

11-
class PropertyAnalyzer
12-
{
11+
class PropertyAnalyzer {
1312
/**
1413
* @var string
1514
*/

src/PHPSemVerChecker/Analyzer/TraitAnalyzer.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66
use PHPSemVerChecker\Operation\TraitRemoved;
77
use PHPSemVerChecker\Registry\Registry;
88
use PHPSemVerChecker\Report\Report;
9-
use PHPSemVerChecker\SemanticVersioning\Level;
109

11-
class TraitAnalyzer
12-
{
10+
class TraitAnalyzer {
1311
protected $context = 'trait';
1412

1513
public function analyze(Registry $registryBefore, Registry $registryAfter)

src/PHPSemVerChecker/Comparator/Signature.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
namespace PHPSemVerChecker\Comparator;
44

5-
class Signature
6-
{
5+
class Signature {
76
/**
87
* @param array $paramsA
98
* @param array $paramsB
@@ -42,7 +41,7 @@ public static function isSameVariables(array $paramsA, array $paramsB)
4241

4342
$iterations = min(count($paramsA), count($paramsB));
4443
for ($i = 0; $i < $iterations; ++$i) {
45-
if ( $paramsA[$i]->name != $paramsB[$i]->name) {
44+
if ($paramsA[$i]->name != $paramsB[$i]->name) {
4645
return false;
4746
}
4847
}

src/PHPSemVerChecker/Comparator/Type.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
namespace PHPSemVerChecker\Comparator;
44

5-
class Type
6-
{
5+
class Type {
76
/**
87
* @param \PhpParser\Node\Name|string $typeA
98
* @param \PhpParser\Node\Name|string $typeB

src/PHPSemVerChecker/Console/Command/CompareCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
6363

6464
$duration = microtime(true) - $startTime;
6565
$output->writeln('');
66-
$output->writeln('Time: '.round($duration, 3).' seconds, Memory: '.round(memory_get_peak_usage() / 1024 / 1024, 3).' MB');
66+
$output->writeln('Time: ' . round($duration, 3) . ' seconds, Memory: ' . round(memory_get_peak_usage() / 1024 / 1024, 3) . ' MB');
6767
}
6868
}

0 commit comments

Comments
 (0)