1 | <?php |
||
24 | class HavingGroupBuilder extends GroupBuilder |
||
25 | { |
||
26 | /** |
||
27 | * @var string[]|Criterion[] |
||
28 | */ |
||
29 | protected const ALLOWED_INNER_TYPES = [ |
||
30 | Where::class => 'applyWhere', |
||
31 | Having::class => 'applyWhere', |
||
32 | WhereGroup::class => 'applyGroup', |
||
33 | ]; |
||
34 | |||
35 | /** |
||
36 | * @param QueryBuilder $builder |
||
37 | * @param CriterionInterface|WhereGroup $group |
||
38 | * @return iterable|null |
||
39 | */ |
||
40 | public function apply($builder, CriterionInterface $group): ?iterable |
||
50 | |||
51 | /** |
||
52 | * @param QueryBuilder $builder |
||
53 | * @param Andx $context |
||
54 | * @param Where $where |
||
55 | * @return \Generator |
||
56 | */ |
||
57 | final protected function applyWhere(QueryBuilder $builder, Andx $context, Where $where): \Generator |
||
68 | } |
||
69 |
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.