AuthUserHelpers::getAuthUser()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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