SongRepository::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace App\Repositories;
4
5
use App\Models\Song;
6
use App\Services\HelperService;
7
8
class SongRepository extends AbstractRepository
9
{
10
    private $helperService;
11
12 132
    public function __construct(HelperService $helperService)
13
    {
14 132
        parent::__construct();
15 132
        $this->helperService = $helperService;
16 132
    }
17
18 132
    public function getModelClass(): string
19
    {
20 132
        return Song::class;
21
    }
22
23 3
    public function getOneByPath(string $path): ?Song
24
    {
25
        /** @var Song|null $song */
26 3
        $song = $this->getOneById($this->helperService->getFileHash($path));
27
28 3
        return $song;
29
    }
30
}
31