DefaultConstantComparator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 17
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A compare() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace gossi\codegen\generator\comparator;
5
6
use gossi\codegen\model\PhpConstant;
7
use phootwork\lang\Comparator;
8
9
/**
10
 * Default property comparator
11
 *
12
 * Orders them by lower cased first, then upper cased
13
 */
14
class DefaultConstantComparator implements Comparator {
15
16
	private $comparator;
17
18 16
	public function __construct() {
19 16
		$this->comparator = new DefaultUseStatementComparator();
20 16
	}
21
22
	/**
23
	 * @param PhpConstant $a
24
	 * @param PhpConstant $b
25
	 */
26 2
	public function compare($a, $b) {
27 2
		return $this->comparator->compare($a->getName(), $b->getName());
28
	}
29
30
}
31