SecuredAuthentication::authRequestData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

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