| Total Complexity | 3 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | class ClosureFileSorter implements FileSorterInterface |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * @var Closure |
||
| 25 | */ |
||
| 26 | private $closure; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Constructor. |
||
| 30 | * |
||
| 31 | * @param Closure $closure Anoymous function which can be used by uasort(). |
||
| 32 | */ |
||
| 33 | 7 | public function __construct(Closure $closure) |
|
| 36 | 7 | } |
|
| 37 | |||
| 38 | /** |
||
| 39 | * Sort files using natural order. |
||
| 40 | * |
||
| 41 | * @param SplFileInfo[] $fileInfos |
||
| 42 | * |
||
| 43 | * @return SplFileInfo[] |
||
| 44 | */ |
||
| 45 | 2 | public function sort(array $fileInfos) |
|
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Returns the closure. |
||
| 54 | * |
||
| 55 | * This method is not part of the FileSorterInterface, but can be used for testing/debugging. |
||
| 56 | * |
||
| 57 | * @return Closure |
||
| 58 | */ |
||
| 59 | 1 | public function getClosure() |
|
| 64 |