ArtistRepository::getModelClass()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace App\Repositories;
4
5
use App\Models\Artist;
6
use App\Models\Song;
7
8
class ArtistRepository extends AbstractRepository
9
{
10 132
    public function getModelClass(): string
11
    {
12 132
        return Artist::class;
13
    }
14
15 7
    public function getNonEmptyArtistIds(): array
16
    {
17 7
        return Song::select('artist_id')
18 7
            ->groupBy('artist_id')
19 7
            ->get()
20 7
            ->pluck('artist_id')
21 7
            ->toArray();
22
    }
23
}
24