| Conditions | 5 |
| Paths | 7 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public static function find(array $arr, $str) |
||
| 15 | { |
||
| 16 | foreach ($arr as $key => $value) { |
||
| 17 | $item = is_int($key) ? $value : $key; |
||
| 18 | |||
| 19 | if(is_string($item) === false) { |
||
| 20 | throw new InvalidArgumentException('Given array contain not string key'); |
||
| 21 | } |
||
| 22 | |||
| 23 | if(self::isMatchedString($item, $str)) { |
||
| 24 | return $item; |
||
| 25 | } |
||
| 26 | } |
||
| 27 | |||
| 28 | return false; |
||
| 29 | } |
||
| 30 | |||
| 41 | } |