| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public static function createFromExpression($expressionString) |
||
| 27 | { |
||
| 28 | $matches = []; |
||
| 29 | $isFunctionExpression = preg_match("/^([a-zA-Z0-9]+)\(([^\(\)]*)\)/", $expressionString, $matches); |
||
| 30 | if (!$isFunctionExpression) { |
||
| 31 | throw new UQLInterpreterException("Unexpected malformated function when trying to extract the parameters."); |
||
| 32 | } |
||
| 33 | |||
| 34 | $functionName = $matches[1]; |
||
| 35 | $arguments = array_filter(array_map('trim', explode(',', $matches[2]))); |
||
| 36 | |||
| 37 | return new self($functionName, $arguments); |
||
| 38 | } |
||
| 39 | |||
| 72 |