Passed
Push — master ( 815c87...2f9749 )
by Alexander
03:36
created

UserRequest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 2
dl 0
loc 8
ccs 2
cts 2
cp 1
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getUser() 0 6 1
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 2
    public function getUser(): User
13
    {
14
        /**
15
         * @var User $identity
16
         */
17 2
        return $this->getValue('attributes.' . Authentication::class);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getValue('...\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