Auth::initInstance()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Bluz Framework Component
5
 *
6
 * @copyright Bluz PHP Team
7
 * @link      https://github.com/bluzphp/framework
8
 */
9
10
declare(strict_types=1);
11
12
namespace Bluz\Proxy;
13
14
use Bluz\Auth\Auth as Instance;
15
use Bluz\Auth\IdentityInterface;
16
17
/**
18
 * Proxy to Auth
19
 *
20
 * Example of usage
21
 *     use Bluz\Proxy\Auth;
22
 *
23
 *     $user = Auth::getIdentity();
24
 *
25
 * @package  Bluz\Proxy
26
 * @author   Anton Shevchuk
27
 *
28
 * @method   static Instance getInstance()
29
 *
30
 * @method   static void setIdentity(IdentityInterface $identity)
31
 * @see      Instance::setIdentity()
32
 *
33
 * @method   static IdentityInterface getIdentity()
34
 * @see      Instance::getIdentity()
35
 *
36
 * @method   static void clearIdentity()
37
 * @see      Instance::clearIdentity()
38
 */
39
final class Auth
40
{
41
    use ProxyTrait;
42
43
    /**
44
     * Init instance
45
     *
46
     * @return Instance
47
     */
48 8
    private static function initInstance(): Instance
0 ignored issues
show
Unused Code introduced by
The method initInstance() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
49
    {
50 8
        $instance = new Instance();
51 8
        $instance->setOptions(Config::get('auth'));
52 8
        return $instance;
53
    }
54
}
55