PathUtils   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 6
c 1
b 0
f 1
dl 0
loc 10
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getRecursivePHPFilesIterator() 0 8 1
1
<?php
2
3
/**
4
 * This file is part of the Cervo package.
5
 *
6
 * Copyright (c) 2010-2019 Nevraxe inc. & Marc André Audet <[email protected]>.
7
 *
8
 * @package   Cervo
9
 * @author    Marc André Audet <[email protected]>
10
 * @copyright 2010 - 2019 Nevraxe inc. & Marc André Audet
11
 * @license   See LICENSE.md  MIT
12
 * @link      https://github.com/Nevraxe/Cervo
13
 * @since     5.0.0
14
 */
15
16
declare(strict_types=1);
17
18
namespace Cervo\Utils;
19
20
/**
21
 * Cervo provider interface.
22
 *
23
 * @author Marc André Audet <[email protected]>
24
 */
25
final class PathUtils
26
{
27
    public static function getRecursivePHPFilesIterator($path)
28
    {
29
        return new \RegexIterator(
30
            new \RecursiveIteratorIterator(
31
                new \RecursiveDirectoryIterator($path)
32
            ),
33
            '/\.php$/i',
34
            \RecursiveRegexIterator::MATCH
35
        );
36
    }
37
}
38