Total Complexity | 3 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | class SortedFileIterator extends SplHeap |
||
24 | { |
||
25 | /** |
||
26 | * @param string $sDirectory |
||
27 | */ |
||
28 | public function __construct(string $sDirectory) |
||
29 | { |
||
30 | $itFile = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($sDirectory)); |
||
31 | foreach($itFile as $xFile) |
||
32 | { |
||
33 | $this->insert($xFile); |
||
34 | } |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * Compare elements in order to place them correctly in the heap |
||
39 | * |
||
40 | * @param mixed $xFile1 |
||
41 | * @param mixed $xFile2 |
||
42 | * |
||
43 | * @return int |
||
44 | */ |
||
45 | public function compare($xFile1, $xFile2): int |
||
48 | } |
||
49 | } |
||
50 |