NoThrottle   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 21
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A shouldThrottle() 0 4 1
A logRequest() 0 4 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