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

Checked::allowCert()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 2
rs 10
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