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

GetFarmingType   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A get() 0 7 1
1
<?php
2
3
4
namespace App\Src\UseCases\Domain\Agricultural\Dto;
5
6
7
use App\Src\UseCases\Domain\Ports\ListRepository;
8
9
class GetFarmingType
10
{
11
    private $listRepository;
12
    const type = 'type_farming';
13
14
    public function __construct(ListRepository $listRepository)
15
    {
16
        $this->listRepository = $listRepository;
17
    }
18
19
    public function get()
20
    {
21
        $mains = $this->listRepository->getByType(self::type, true);
22
        $others = $this->listRepository->getByType(self::type, false);
23
        return [
24
            'main' => $mains,
25
            'others' => $others,
26
        ];
27
    }
28
}
29