Completed
Push — master ( 353f9b...9d046b )
by Níckolas Daniel
05:04
created

OutputFileCollection::fetchByPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace PODEntender\Domain\Model\FileProcessing;
4
5
use Illuminate\Support\Collection;
6
7
class OutputFileCollection extends Collection
8
{
9 3
    public function fetchByPath(string $path): ?OutputFile
10
    {
11
        return $this
12
            ->filter(function (OutputFile $file) use ($path) {
13 3
                return $file->path() === $path;
14 3
            })
15 3
            ->first();
16
    }
17
}
18