Completed
Push — master ( dbf778...092870 )
by Mahmoud
04:22
created

ListTimeTrackerAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 40
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A all() 0 6 1
1
<?php
2
3
namespace App\Containers\Tracker\Actions;
4
5
use App\Containers\Tracker\Settings\Repositories\TimeTrackerRepository;
6
use App\Containers\User\Services\FindUserService;
7
use App\Port\Action\Abstracts\Action;
8
9
/**
10
 * Class ListTimeTrackerAction.
11
 *
12
 * @author Mahmoud Zalt <[email protected]>
13
 */
14
class ListTimeTrackerAction extends Action
15
{
16
17
18
    /**
19
     * @var  \App\Containers\Tracker\Actions\TimeTrackerRepository
20
     */
21
    private $timeTrackerRepository;
22
23
    /**
24
     * @var  \App\Containers\User\Services\FindUserService
25
     */
26
    private $findUserService;
27
28
    /**
29
     * ListTimeTrackerAction constructor.
30
     *
31
     * @param \App\Containers\Tracker\Actions\TimeTrackerRepository $timeTrackerRepository
32
     * @param \App\Containers\User\Services\FindUserService         $findUserService
33
     */
34
    public function __construct(TimeTrackerRepository $timeTrackerRepository, FindUserService $findUserService)
35
    {
36
        $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...
37
        $this->findUserService = $findUserService;
38
    }
39
40
    /**
41
     * @param array $relations
42
     *
43
     * @return  mixed
44
     */
45
    public function all($relations = ['user'])
46
    {
47
        $this->timeTrackerRepository->with($relations);
48
49
        return $this->timeTrackerRepository->paginate();
50
    }
51
52
53
}
54