ArtistRepository   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 7
c 0
b 0
f 0
dl 0
loc 14
ccs 8
cts 8
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getNonEmptyArtistIds() 0 7 1
A getModelClass() 0 3 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