AuthenticationProcess::authenticate()   A
last analyzed

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 0
Metric Value
eloc 3
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
namespace kalanis\Restful\Security\Process;
4
5
6
use kalanis\Restful\Http\IInput;
7
8
9
/**
10
 * Request AuthenticationProcess template
11
 * @package kalanis\Restful\Security\Process
12
 */
13
abstract class AuthenticationProcess
14
{
15
16
    /**
17
     * Authenticate process
18
     */
19
    public function authenticate(IInput $input): bool
20
    {
21 1
        $r1 = $this->authRequestData($input);
22 1
        $r2 = $this->authRequestTimeout($input);
23 1
        return $r1 && $r2;
24
    }
25
26
    /**
27
     * Authenticate request data
28
     */
29
    abstract protected function authRequestData(IInput $input): bool;
30
31
    /**
32
     * Authenticate request timeout
33
     */
34
    abstract protected function authRequestTimeout(IInput $input): bool;
35
}
36