SecuredAuthentication   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 3
dl 0
loc 24
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A authRequestData() 0 3 1
A __construct() 0 5 1
A authRequestTimeout() 0 3 1
1
<?php
2
3
namespace kalanis\Restful\Security\Process;
4
5
6
use kalanis\Restful\Http\IInput;
7
use kalanis\Restful\Security\Authentication\HashAuthenticator;
8
use kalanis\Restful\Security\Authentication\TimeoutAuthenticator;
9
10
11
/**
12
 * SecuredAuthentication process
13
 * @package kalanis\Restful\Security\Process
14
 */
15 1
class SecuredAuthentication extends AuthenticationProcess
16
{
17
18 1
    public function __construct(
19
        private readonly HashAuthenticator    $hashAuth,
20
        private readonly TimeoutAuthenticator $timeAuth,
21
    )
22
    {
23 1
    }
24
25
    /**
26
     * Authenticate request data
27
     */
28
    protected function authRequestData(IInput $input): bool
29
    {
30 1
        return $this->hashAuth->authenticate($input);
31
    }
32
33
    /**
34
     * Authenticate request time
35
     */
36
    protected function authRequestTimeout(IInput $input): bool
37
    {
38 1
        return $this->timeAuth->authenticate($input);
39
    }
40
}
41