Test Failed
Push — master ( 09a5f1...c566a2 )
by Alexander
12:51
created

UserRequest::getUser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 1
c 2
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\User;
6
7
use Yiisoft\Auth\Middleware\Authentication;
8
use Yiisoft\RequestModel\RequestModel;
9
10
final class UserRequest extends RequestModel
11
{
12
    public function getUser(): User
13
    {
14
        /**
15
         * @var User $identity
16
         */
17
        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\User\User. Consider adding an additional type-check to rule them out.
Loading history...
18
    }
19
}
20