NoThrottle::logRequest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 1
crap 1
1
<?php
2
namespace LunixREST\Server\Throttle;
3
4
use LunixREST\Server\APIRequest\APIRequest;
5
6
/**
7
 * A throttle that never throttles.
8
 * Class NoThrottle
9
 * @package LunixREST\Server\Throttle
10
 */
11
class NoThrottle implements Throttle
12
{
13
    /**
14
     * Never throttle
15
     * @param \LunixREST\Server\APIRequest\APIRequest $request
16
     * @return bool
17
     */
18 3
    public function shouldThrottle(APIRequest $request): bool
19
    {
20 3
        return false;
21
    }
22
23
    /**
24
     * Log that a request took place
25
     * @param \LunixREST\Server\APIRequest\APIRequest $request
26
     */
27 2
    public function logRequest(APIRequest $request): void
28
    {
29
        //Do nothing
30 2
    }
31
}
32