BaseAuthPlugin   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
eloc 7
c 0
b 0
f 0
dl 0
loc 59
ccs 11
cts 11
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A login() 0 3 1
A getAuth() 0 3 1
A verify() 0 3 1
A setAuth() 0 3 1
A logout() 0 3 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