Completed
Push — master ( 0647d9...63117e )
by Sebastian
02:16
created

Max   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 0 7 2
1
<?php
2
3
/**
4
 * Linna Filter
5
 *
6
 * @author Sebastian Rapetti <[email protected]>
7
 * @copyright (c) 2017, Sebastian Rapetti
8
 * @license http://opensource.org/licenses/MIT MIT License
9
 */
10
declare(strict_types = 1);
11
12
namespace Linna\Filter\Rules;
13
14
/**
15
 * Check if value is above a maximum.
16
 */
17
class Max
18
{
19
    /**
20
     * Validate.
21
     *
22
     * @return bool
23
     */
24 6
    public function validate($received, $max): bool
25
    {
26 6
        if ($received > $max) {
27 2
            return true;
28
        }
29
30 4
        return false;
31
    }
32
}
33