Passed
Push — master ( fd66bc...1c0213 )
by Ax
05:30
created

Validation::contains()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 1
b 0
f 0
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