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

Implementation   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 22
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A isSame() 0 14 1
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