1 | <?php |
||
21 | final class IsEmpty implements Filter, Satisfiable |
||
22 | { |
||
23 | /** |
||
24 | * @var Operand|string |
||
25 | */ |
||
26 | private $field; |
||
27 | |||
28 | /** |
||
29 | * @var string|null |
||
30 | */ |
||
31 | private $context; |
||
32 | |||
33 | /** |
||
34 | * @param Operand|string $field |
||
35 | * @param string|null $context |
||
36 | */ |
||
37 | public function __construct($field, ?string $context = null) |
||
42 | |||
43 | /** |
||
44 | * @param QueryBuilder $qb |
||
45 | * @param string $context |
||
46 | * |
||
47 | * @return string |
||
48 | */ |
||
49 | public function getFilter(QueryBuilder $qb, string $context): string |
||
59 | |||
60 | /** |
||
61 | * {@inheritdoc} |
||
62 | */ |
||
63 | public function filterCollection(iterable $collection, ?string $context = null): iterable |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | public function isSatisfiedBy($candidate, ?string $context = null): bool |
||
85 | |||
86 | /** |
||
87 | * @param string|null $context |
||
88 | * |
||
89 | * @return string|null |
||
90 | */ |
||
91 | private function resolveContext(?string $context): ?string |
||
103 | } |
||
104 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.