Skip to content

Commit 73a4ac0

Browse files
committed
fix travis
1 parent c0dc802 commit 73a4ac0

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
<?php
22
namespace gossi\codegen\generator\comparator;
33

4-
use phootwork\lang\Comparator;
54
use gossi\codegen\model\PhpConstant;
5+
use phootwork\lang\Comparator;
66

77
class DefaultConstantComparator implements Comparator {
8-
8+
9+
private $comparator;
10+
11+
public function __construct() {
12+
$this->comparator = new DefaultUseStatementComparator();
13+
}
14+
915
/**
1016
* @param PhpConstant $a
1117
* @param PhpConstant $b
1218
*/
1319
public function compare($a, $b) {
14-
return strcasecmp($a->getName(), $b->getName());
20+
return $this->comparator->compare($a->getName(), $b->getName());
1521
}
1622

1723
}

tests/generator/SortTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ public function testDefaultConstantComparator() {
5757
$ordered = $list->map(function ($item) {
5858
return $item->getName();
5959
})->toArray();
60-
60+
6161
$this->assertEquals([
6262
'bar',
63+
'baz',
6364
'BAR',
6465
'BAZ',
65-
'baz',
6666
'FOO'
6767
], $ordered);
6868
}

0 commit comments

Comments
 (0)