AuthUserHelpers   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getAuthUser() 0 3 1
A getAuthUserId() 0 3 1
1
<?php
2
3
namespace Yeelight\Traits;
4
5
/**
6
 * Trait AuthUserHelpers
7
 *
8
 * @category Yeelight
9
 *
10
 * @package Yeelight\Traits
11
 *
12
 * @author Sheldon Lee <[email protected]>
13
 *
14
 * @license https://opensource.org/licenses/MIT MIT
15
 *
16
 * @link https://www.yeelight.com
17
 */
18
trait AuthUserHelpers
19
{
20
    /**
21
     * GetAuthUser
22
     *
23
     * @return \Yeelight\Models\Foundation\User
24
     */
25
    public function getAuthUser()
26
    {
27
        return current_auth_user();
28
    }
29
30
    /**
31
     * GetAuthUserId
32
     *
33
     * @return mixed|null
34
     */
35
    public function getAuthUserId()
36
    {
37
        return $this->getAuthUser()->getUserId();
38
    }
39
}
40