| Conditions | 5 |
| Paths | 6 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 8 | public static function find() |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var $obj ActiveRecord |
||
| 12 | */ |
||
| 13 | $obj = new static; |
||
| 14 | $class = new \ReflectionClass($obj); |
||
| 15 | $condition = []; |
||
| 16 | foreach ($class->getProperties(\ReflectionProperty::IS_STATIC) as $property) { |
||
| 17 | if (strpos($property->getName(), 'BEFORE_QUERY') !== false && is_array($property->getValue($obj))) { |
||
| 18 | $condition = array_merge($condition, $property->getValue($obj)); |
||
| 19 | } |
||
| 20 | } |
||
| 21 | if($obj->hasAttribute($obj->removedAttribute)) |
||
| 22 | return (new \sibds\behaviors\TrashQuery($obj))->findRemoved()->andFilterWhere($condition); |
||
|
|
|||
| 23 | else |
||
| 24 | return parent::find()->andFilterWhere($condition); |
||
| 25 | } |
||
| 26 | } |
||
| 27 |
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: