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

OutputFileCollection   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 5
dl 0
loc 9
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A fetchByPath() 0 7 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