ConfigFinder   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 13
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpNsFixer\Finder;
6
7
use Symfony\Component\Finder\Finder;
8
use Symfony\Component\Finder\SplFileInfo;
9
10
final class ConfigFinder
11
{
12 2
    public static function get(string $path): ?SplFileInfo
13
    {
14 2
        $finder = Finder::create()
15 2
            ->name('composer.json')
16 2
            ->in($path)
17 2
            ->depth('== 0')
18 2
            ->getIterator();
19
20 2
        $finder->rewind();
21
22 2
        return $finder->current();
23
    }
24
}
25