| Conditions | 3 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 66 | 27 | public function isReference( |
|
| 67 | mixed $value, |
||
| 68 | array $registeredVariables = [] |
||
| 69 | ): bool { |
||
| 70 | /** @psalm-suppress ArgumentTypeCoercion */ |
||
| 71 | 27 | $variables = implode('|', $registeredVariables); |
|
| 72 | |||
| 73 | 27 | if (! is_string($value) || empty($value)) { |
|
| 74 | 2 | return false; |
|
| 75 | } |
||
| 76 | |||
| 77 | 27 | return (bool) preg_match( |
|
| 78 | 27 | '/^(' |
|
| 79 | . $variables |
||
| 80 | . '|CURRENT|NEW|OLD)(\[\`.+\`\]|\[[\d\w\*]*\])*(\.(\`.+\`|@?[\d\w]*)(\[\`.+\`\]|\[[\d\w\*]*\])*)*$/', |
||
| 81 | $value |
||
| 82 | ); |
||
| 85 |