File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<?php
22namespace gossi \codegen \generator \comparator ;
33
4- use phootwork \lang \Comparator ;
54use gossi \codegen \model \PhpConstant ;
5+ use phootwork \lang \Comparator ;
66
77class 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}
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments