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

NestedTypeParanoia   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 10
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A MaybeFoundInArray() 0 5 2
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