BaseAuthPlugin::getAuth()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Vectorface\Auth\Plugin;
4
5
use Vectorface\Auth\Auth;
6
7
/**
8
 * Represents a base auth plugin.
9
 */
10
abstract class BaseAuthPlugin implements AuthPluginInterface
11
{
12
    /**
13
     * Calling Security Class
14
     *
15
     * @var Auth
16
     */
17
    private $auth;
18
19
    /**
20
     * Store the Auth class into which this plugin will plug. Called by the Auth class on plugin addition.
21
     *
22
     * @param Auth $auth
23
     */
24 11
    public function setAuth(Auth $auth)
25
    {
26 11
        $this->auth = $auth;
27 11
    }
28
29
    /**
30
     * Get the Auth class instance
31
     *
32
     * @return Auth
33
     */
34 3
    protected function getAuth()
35
    {
36 3
        return $this->auth;
37
    }
38
39
    /**
40
     * Attempt to log the user in to the system.
41
     *
42
     * @param string $username The unique identifier for the user.
43
     * @param string $password The user's password.
44
     * @return int The login result.
45
     */
46 1
    public function login($username, $password)
47
    {
48 1
        return Auth::RESULT_NOOP;
49
    }
50
51
    /**
52
     * Attempt to log the user out of the system.
53
     *
54
     * @return int The logout result.
55
     */
56 1
    public function logout()
57
    {
58 1
        return Auth::RESULT_NOOP;
59
    }
60
61
    /**
62
     * Attempt to verify the user's login status.
63
     *
64
     * @return int The user's login status.
65
     */
66 1
    public function verify()
67
    {
68 1
        return Auth::RESULT_NOOP;
69
    }
70
}
71