Validation   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 22
rs 10
c 1
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A contains() 0 3 1
A between() 0 3 2
1
<?php
2
3
namespace SchoppAx\Sleeper\Api\Utility;
4
5
class Validation
6
{
7
8
    /**
9
     * @param int $val
10
     * @param int $min
11
     * @param int $max
12
     * @return bool
13
     */
14
    public static function between(int $val, int $min, int $max)
15
    {
16
      return ($val >= $min && $val <= $max);
17
    }
18
19
    /**
20
     * @param array $arr
21
     * @param string $val
22
     * @return bool (json) of called api resource
23
     */
24
    public static function contains(array $arr, string $val)
25
    {
26
      return in_array($val, $arr);
27
    }
28
29
}
30