1 | <?php |
||
24 | class GroupBuilder extends Builder |
||
25 | { |
||
26 | /** |
||
27 | * @var string[]|Criterion[] |
||
28 | */ |
||
29 | protected const ALLOWED_INNER_TYPES = [ |
||
30 | Where::class => 'applyWhere', |
||
31 | WhereGroup::class => 'applyGroup' |
||
32 | ]; |
||
33 | |||
34 | /** |
||
35 | * @param QueryBuilder $builder |
||
36 | * @param CriterionInterface|WhereGroup $group |
||
37 | * @return iterable|null |
||
38 | */ |
||
39 | 2 | public function apply($builder, CriterionInterface $group): ?iterable |
|
51 | |||
52 | /** |
||
53 | * @param QueryBuilder $builder |
||
54 | * @param Andx $context |
||
55 | * @param WhereGroup $group |
||
56 | * @return \Generator |
||
57 | */ |
||
58 | protected function applyGroup(QueryBuilder $builder, Andx $context, WhereGroup $group): \Generator |
||
62 | |||
63 | /** |
||
64 | * @param QueryBuilder $builder |
||
65 | * @param Andx $context |
||
66 | * @param Where $where |
||
67 | * @return \Generator |
||
68 | */ |
||
69 | 2 | protected function applyWhere(QueryBuilder $builder, Andx $context, Where $where): \Generator |
|
80 | |||
81 | /** |
||
82 | * @param WhereGroup $group |
||
83 | * @return iterable|callable[] |
||
84 | */ |
||
85 | 2 | protected function getInnerSelections(WhereGroup $group): iterable |
|
101 | } |
||
102 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.