Completed
Push — master ( 76b2d2...bf58d7 )
by Mahmoud
05:01
created

ListTimeTrackersTask::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace App\Containers\Tracker\Tasks;
4
5
use App\Containers\Tracker\Data\Repositories\TimeTrackerRepository;
6
use App\Port\Task\Abstracts\Task;
7
8
/**
9
 * Class ListTimeTrackersTask.
10
 *
11
 * @author Mahmoud Zalt <[email protected]>
12
 */
13
class ListTimeTrackersTask extends Task
14
{
15
16
17
    /**
18
     * @var  \App\Containers\Tracker\Actions\TimeTrackerRepository
19
     */
20
    private $timeTrackerRepository;
21
22
    /**
23
     * ListTimeTrackerAction constructor.
24
     *
25
     * @param \App\Containers\Tracker\Data\Repositories\TimeTrackerRepository $timeTrackerRepository
26
     */
27
    public function __construct(TimeTrackerRepository $timeTrackerRepository)
28
    {
29
        $this->timeTrackerRepository = $timeTrackerRepository;
0 ignored issues
show
Documentation Bug introduced by
It seems like $timeTrackerRepository of type object<App\Containers\Tr...\TimeTrackerRepository> is incompatible with the declared type object<App\Containers\Tr...\TimeTrackerRepository> of property $timeTrackerRepository.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
30
    }
31
32
    /**
33
     * @param array $relations
34
     *
35
     * @return  mixed
36
     */
37
    public function run($relations = ['user'])
38
    {
39
        $this->timeTrackerRepository->with($relations);
40
41
        return $this->timeTrackerRepository->paginate();
42
    }
43
44
45
}
46