Completed
Push — master ( 5294dc...c896df )
by T
04:42
created

Implementation::isSame()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 14
rs 9.4285
cc 1
eloc 5
nc 1
nop 2
1
<?php
2
3
namespace PHPSemVerChecker\Comparator;
4
5
use PhpParser\NodeDumper;
6
7
class Implementation
8
{
9
	/**
10
	 * @param array $statementsA
11
	 * @param array $statementsB
12
	 * @return bool
13
	 */
14
	public static function isSame(array $statementsA, array $statementsB)
15
	{
16
		// Naive way to check if two implementation are the same
17
		$nodeDumper = new NodeDumper();
18
19
		$dumpA = $nodeDumper->dump($statementsA);
20
		$dumpB = $nodeDumper->dump($statementsB);
21
22
//		var_dump($dumpA === $dumpB);
0 ignored issues
show
Unused Code Comprehensibility introduced by
45% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
23
//		var_dump($statementsA == $statementsB);
24
//		echo '-----'.PHP_EOL;
25
26
		return $dumpA === $dumpB;
27
	}
28
}
29