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

GetAuthenticatedUserTask::__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\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