Conditions | 3 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
40 | public static function actionExpressionArgumentIsMalformed($actionName, $expression, $expressionResult) |
||
41 | { |
||
42 | if (is_array($expressionResult) && ArrayUtils::isArrayAssoc($expressionResult)) { |
||
43 | // assoc array |
||
44 | $actualResultDescription = sprintf('associative array "%s"', json_encode($expressionResult)); |
||
45 | } else { |
||
46 | // non scalar value |
||
47 | $actualResultDescription = gettype($expressionResult); |
||
48 | } |
||
49 | |||
50 | return new static( |
||
51 | sprintf('Action reference with name "%s" has expression-defined argument "%s" which'. |
||
52 | ' result must be scalar or non-associative array. Actual result is %s', |
||
53 | $actionName, |
||
54 | $expression, |
||
55 | $actualResultDescription |
||
56 | ) |
||
57 | ); |
||
58 | } |
||
59 | } |