Passed
Push — master ( 4a884d...c9d1fc )
by Jeff
12:14
created

StateRepository::listCities()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Shop\States\Repositories;
4
5
use App\Shop\Base\BaseRepository;
6
use App\Shop\Cities\City;
7
use App\Shop\Cities\Repositories\CityRepository;
8
use App\Shop\States\State;
9
use Illuminate\Support\Collection;
10
11
class StateRepository extends BaseRepository implements StateRepositoryInterface
12
{
13
    /**
14
     * StateRepository constructor.
15
     *
16
     * @param State $state
17
     */
18
    public function __construct(State $state)
19
    {
20
        parent::__construct($state);
21
        $this->model = $state;
22
    }
23
24
    /**
25
     * @return Collection
26
     */
27
    public function listCities(): Collection
28
    {
29
        $cityRepo = new CityRepository(new City);
30
        return $cityRepo->listCitiesByStateCode($this->model->state_code);
31
    }
32
}