CocotteFinder::exactFile()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Cocotte\Finder;
4
5
final class CocotteFinder extends \Symfony\Component\Finder\Finder implements Finder
6
{
7
    public function exactFile(string $realPath): Finder
8
    {
9
        $search = new \SplFileInfo($realPath);
10
11
        return $this->in($search->getPath())->filter(
12
            function (\SplFileInfo $found) use ($search) {
13
                return $search->getRealPath() === $found->getRealPath();
14
            }
15
        );
16
    }
17
18
}