Test Failed
Pull Request — master (#87)
by Dmitriy
02:38
created

Request::getUser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Infrastructure\IO\Http\Auth\PostLogout\Request;
6
7
use App\Application\User\Entity\User;
8
use Yiisoft\Auth\Middleware\Authentication;
9
use Yiisoft\RequestModel\RequestModel;
10
11
final class Request extends RequestModel
12
{
13
    public function getUser(): User
14
    {
15
        /**
16
         * @var User $identity
17
         */
18
        return $this->getAttributeValue('attributes.' . Authentication::class);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getAttribu...\Authentication::class) could return the type null which is incompatible with the type-hinted return App\Application\User\Entity\User. Consider adding an additional type-check to rule them out.
Loading history...
19
    }
20
}
21