1 | <?php |
||
10 | class ArgumentToOperandConverter |
||
11 | { |
||
12 | /** |
||
13 | * Convert the argument into the field operand if it is not an operand. |
||
14 | * |
||
15 | * @param Operand|string $argument |
||
16 | * |
||
17 | * @return Operand |
||
18 | */ |
||
19 | public static function toField($argument) |
||
27 | |||
28 | /** |
||
29 | * Convert the argument into the value operand if it is not an operand. |
||
30 | * |
||
31 | * @param Operand|string $argument |
||
32 | * |
||
33 | * @return Operand |
||
34 | */ |
||
35 | public static function toValue($argument) |
||
43 | |||
44 | /** |
||
45 | * Are all arguments is a operands? |
||
46 | * |
||
47 | * @param array $arguments |
||
48 | * |
||
49 | * @return bool |
||
50 | */ |
||
51 | public static function isAllOperands(array $arguments) |
||
61 | |||
62 | /** |
||
63 | * Convert all possible arguments to operands. |
||
64 | * |
||
65 | * @param Operand[]|string[] $arguments |
||
66 | * |
||
67 | * @throws NotConvertibleException |
||
68 | * |
||
69 | * @return Operand[] |
||
70 | */ |
||
71 | public static function convert(array $arguments) |
||
102 | } |
||
103 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.