ConfigFinder::get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 1
dl 0
loc 11
ccs 8
cts 8
cp 1
crap 1
rs 10
c 0
b 0
f 0
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