Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
7 / 7 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
recursive_path_iterator | |
100.00% |
7 / 7 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |||
getInnerIterator | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | /** |
3 | * |
4 | * This file is part of the phpBB Forum Software package. |
5 | * |
6 | * @copyright (c) phpBB Limited <https://www.phpbb.com> |
7 | * @license GNU General Public License, version 2 (GPL-2.0) |
8 | * |
9 | * For full copyright and license information, please see |
10 | * the docs/CREDITS.txt file. |
11 | * |
12 | */ |
13 | |
14 | declare(strict_types=1); |
15 | |
16 | namespace phpbb\finder; |
17 | |
18 | class recursive_path_iterator extends \RecursiveIteratorIterator |
19 | { |
20 | /** |
21 | * Constructor |
22 | * |
23 | * @param string $path Path to iterate over |
24 | * @param int $mode Iterator mode |
25 | * @param int $flags Flags |
26 | */ |
27 | public function __construct(string $path, int $mode = self::LEAVES_ONLY, int $flags = \FilesystemIterator::SKIP_DOTS) |
28 | { |
29 | parent::__construct( |
30 | new recursive_dot_prefix_filter_iterator(new \RecursiveDirectoryIterator($path, $flags)), |
31 | \RecursiveIteratorIterator::SELF_FIRST |
32 | ); |
33 | } |
34 | |
35 | /** |
36 | * Get inner iterator |
37 | * |
38 | * @return recursive_dot_prefix_filter_iterator |
39 | */ |
40 | public function getInnerIterator(): \RecursiveIterator |
41 | { |
42 | $inner_iterator = parent::getInnerIterator(); |
43 | |
44 | assert($inner_iterator instanceof recursive_dot_prefix_filter_iterator); |
45 | return $inner_iterator; |
46 | } |
47 | } |