Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
24 | 11 | public function writeElements(array $constants) |
|
25 | { |
||
26 | // see https://bugs.php.net/bug.php?id=50688 |
||
27 | 11 | @usort($constants, function(IReflectionConstant $a, IReflectionConstant $b) { |
|
|
|||
28 | 3 | return strnatcasecmp($a->getName(), $b->getName()); |
|
29 | 11 | }); |
|
30 | |||
31 | 11 | $constantsString = ''; |
|
32 | 11 | foreach ($constants as $constant) { |
|
33 | /** @var $property IReflectionConstant */ |
||
34 | 3 | $constantsString .= $this->writeElement($constant); |
|
35 | 11 | } |
|
36 | 11 | return $constantsString; |
|
37 | } |
||
38 | } |
||
39 |
If you suppress an error, we recommend checking for the error condition explicitly: