Completed
Push — master ( dc4a43...c534b9 )
by Mahmoud
05:31
created

GetAuthenticatedUserTask   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A run() 0 4 1
1
<?php
2
3
namespace App\Containers\User\Tasks;
4
5
use App\Port\Task\Abstracts\Task;
6
use Illuminate\Auth\AuthManager as Auth;
7
8
/**
9
 * Class GetAuthenticatedUserTask.
10
 *
11
 * @author Mahmoud Zalt <[email protected]>
12
 */
13
class GetAuthenticatedUserTask extends Task
14
{
15
16
    /**
17
     * @var  \App\Containers\User\Tasks\Auth
18
     */
19
    private $auth;
20
21
    /**
22
     * GetAuthenticatedUserTask constructor.
23
     *
24
     * @param \App\Containers\User\Tasks\Auth $auth
25
     */
26
    public function __construct(Auth $auth)
27
    {
28
        $this->auth = $auth;
0 ignored issues
show
Documentation Bug introduced by
It seems like $auth of type object<Illuminate\Auth\AuthManager> is incompatible with the declared type object<App\Containers\User\Tasks\Auth> of property $auth.

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...
29
    }
30
31
    /**
32
     * @param $id
33
     *
34
     * @return  mixed
35
     */
36
    public function run()
37
    {
38
        return $this->auth->user();
39
    }
40
41
}
42