Test Failed
Push — master ( 1b5e16...d3ba44 )
by SignpostMarv
09:05
created

NestedTypeParanoia::MaybeFoundInArray()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
* Base daft objects.
4
*
5
* @author SignpostMarv
6
*/
7
declare(strict_types=1);
8
9
namespace SignpostMarv\DaftObject;
10
11
class NestedTypeParanoia extends TypeParanoia
12
{
13
    /**
14
    * @param mixed $needle
15
    */
16
    public static function MaybeFoundInArray($needle, array $haystack) : ? int
17
    {
18
        $out = array_search($needle, $haystack, true);
19
20
        return is_int($out) ? $out : null;
21
    }
22
}
23