Passed
Push — master ( 1ffd02...b93f0b )
by Bertrand
06:21
created

ListRepositorySql   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 10
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getByType() 0 8 1
1
<?php
2
3
4
namespace App\Src\UseCases\Infra\Sql;
5
6
7
use App\Src\UseCases\Domain\Ports\ListRepository;
8
use Illuminate\Support\Facades\DB;
9
10
class ListRepositorySql implements ListRepository
11
{
12
    public function getByType(string $type, bool $isMain): array
13
    {
14
        $list = DB::table('list')
15
            ->where('type', $type)
16
            ->where('main', $isMain)
17
            ->orderBy('priority')
18
            ->get();
19
        return $list->toArray();
20
    }
21
}
22