Passed
Push — master ( 141183...2b56eb )
by Petr
08:03
created

Checked   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 15
ccs 6
cts 6
cp 1
rs 10
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A allowCert() 0 5 2
A allowLogin() 0 5 2
1
<?php
2
3
namespace kalanis\kw_auth\Statuses;
4
5
6
use kalanis\kw_auth\Interfaces;
7
8
9
/**
10
 * Class Checked
11
 * @package kalanis\kw_auth\Statuses
12
 * Authenticate - is allowed to use any available method?
13
 */
14
class Checked implements Interfaces\IStatus
15
{
16 6
    public function allowLogin(?int $status): bool
17
    {
18 6
        return is_int($status) && in_array($status, [
19 6
            Interfaces\IUser::USER_STATUS_ENABLED,
20
            Interfaces\IUser::USER_STATUS_ONLY_LOGIN,
21
        ]);
22
    }
23
24 6
    public function allowCert(?int $status): bool
25
    {
26 6
        return is_int($status) && in_array($status, [
27 6
            Interfaces\IUser::USER_STATUS_ENABLED,
28
            Interfaces\IUser::USER_STATUS_ONLY_CERT,
29
        ]);
30
    }
31
}
32