Conditions | 4 |
Paths | 4 |
Total Lines | 23 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
40 | public function isRegexLike(string $value): bool |
||
41 | { |
||
42 | $valueLength = strlen($value); |
||
43 | |||
44 | if ($valueLength < 2) { |
||
45 | return false; |
||
46 | } |
||
47 | |||
48 | $firstCharacter = $value[0]; |
||
49 | |||
50 | $parts = explode($firstCharacter, $value); |
||
51 | |||
52 | if (count($parts) !== 3) { |
||
53 | return false; |
||
54 | } |
||
55 | |||
56 | $lastPart = array_pop($parts); |
||
57 | |||
58 | if (!self::isValidRegexFlags($lastPart)) { |
||
59 | return false; |
||
60 | } |
||
61 | |||
62 | return true; |
||
63 | } |
||
95 |