ListAllCountriesTask   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 30
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A run() 0 8 1
1
<?php
2
3
namespace App\Containers\Country\Tasks;
4
5
use App\Containers\Country\Data\Repositories\CountryRepository;
6
use App\Ship\Parents\Tasks\Task;
7
use App\Ship\Features\Criterias\Eloquent\OrderByNameCriteria;
8
9
/**
10
 * Class ListAllCountriesTask.
11
 *
12
 * @author Mahmoud Zalt <[email protected]>
13
 */
14
class ListAllCountriesTask extends Task
15
{
16
    /**
17
     * @var \App\Containers\Country\Data\Repositories\CountryRepository
18
     */
19
    private $countryRepository;
20
21
    /**
22
     * ListAllCountriesTask constructor.
23
     *
24
     * @param \App\Containers\Country\Data\Repositories\CountryRepository $countryRepository
25
     */
26
    public function __construct(CountryRepository $countryRepository)
27
    {
28
        $this->countryRepository = $countryRepository;
29
    }
30
31
    /**
32
     * @return  mixed
33
     */
34
    public function run()
35
    {
36
        $this->countryRepository->pushCriteria(new OrderByNameCriteria());
37
38
        $countryRequests = $this->countryRepository->all();
39
40
        return $countryRequests;
41
    }
42
43
}
44