| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | function bom_match(string $str): string |
||
| 29 | { |
||
| 30 | 162 | static $list; |
|
| 31 | |||
| 32 | 162 | $list = $list ?? (new ReflectionClass(BOM::class))->getConstants(); |
|
| 33 | |||
| 34 | 162 | foreach ($list as $sequence) { |
|
| 35 | 162 | if (0 === strpos($str, $sequence)) { |
|
| 36 | 94 | return $sequence; |
|
| 37 | } |
||
| 38 | } |
||
| 39 | |||
| 40 | 136 | return ''; |
|
| 41 | } |
||
| 42 | |||
| 58 |