Total Complexity | 3 |
Total Lines | 19 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | trait UserTrait |
||
8 | { |
||
9 | /** |
||
10 | * @var IdentityInterface |
||
11 | */ |
||
12 | private $user; |
||
13 | |||
14 | public function getUser(): ?IdentityInterface |
||
15 | { |
||
16 | if ($this->user === null) { |
||
17 | $this->user = Yii::$app->getUser()->getIdentity(); |
||
18 | } |
||
19 | |||
20 | return $this->user; |
||
21 | } |
||
22 | |||
23 | public function setUser(IdentityInterface $user) |
||
26 | } |
||
27 | } |