| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4.016 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 86 | 5 | public function isReference($value, $registeredVariables = []): bool |
|
| 87 | { |
||
| 88 | 5 | $variables = ''; |
|
| 89 | 5 | if (!empty($registeredVariables)) { |
|
| 90 | 5 | $variables = implode('|', $registeredVariables); |
|
| 91 | } |
||
| 92 | |||
| 93 | 5 | if (! is_string($value) || empty($value)) { |
|
| 94 | return false; |
||
| 95 | } |
||
| 96 | |||
| 97 | 5 | return (bool) preg_match( |
|
| 98 | 5 | '/^(' |
|
| 99 | 5 | . $variables |
|
| 100 | 5 | . '|CURRENT|NEW|OLD)(\[\`.+\`\]|\[[\d\w\*]*\])*(\.(\`.+\`|@?[\d\w]*)(\[\`.+\`\]|\[[\d\w\*]*\])*)*$/', |
|
| 101 | $value |
||
| 102 | ); |
||
| 105 |