1 | <?php |
||
9 | class Condition |
||
10 | { |
||
11 | /** AND(conjunction) - Condition relation type */ |
||
12 | const REL_AND = 'AND'; |
||
13 | |||
14 | /** OR(disjunction) - Condition relation type */ |
||
15 | const REL_OR = 'OR'; |
||
16 | |||
17 | /** @var Argument[] Collection of condition arguments */ |
||
18 | public $arguments = array(); |
||
19 | |||
20 | /** @var string Relation logic between arguments */ |
||
21 | public $relation = self::REL_AND; |
||
22 | |||
23 | /** |
||
24 | * Add condition argument to this condition group |
||
25 | * @param Argument $argument Condition argument to be added |
||
26 | */ |
||
27 | public function addArgument(Argument $argument) |
||
32 | |||
33 | /** |
||
34 | * Add condition group to this condition group |
||
35 | * @param Condition $condition Condition group to be added |
||
36 | */ |
||
37 | public function addCondition(self $condition) |
||
42 | |||
43 | /** |
||
44 | * Generic condition addiction function |
||
45 | * @param self|Argument|string $argument Entity for adding to arguments collection |
||
46 | * @param string $value Argument value |
||
47 | * @param string $relation Relation between argument and value |
||
48 | * @return self Chaining |
||
49 | */ |
||
50 | public function add($argument, $value = '', $relation = Relation::EQUAL) |
||
63 | |||
64 | /** |
||
65 | * Constructor |
||
66 | * @param string $relation Relation type between arguments |
||
67 | */ |
||
68 | public function __construct($relation = null) |
||
72 | } |
||
73 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: