1 | <?php |
||
21 | final class In implements Filter, Satisfiable |
||
22 | { |
||
23 | /** |
||
24 | * @var Operand|string |
||
25 | */ |
||
26 | private $field; |
||
27 | |||
28 | /** |
||
29 | * @var Operand|mixed |
||
30 | */ |
||
31 | private $value; |
||
32 | |||
33 | /** |
||
34 | * @var string|null |
||
35 | */ |
||
36 | private $context; |
||
37 | |||
38 | /** |
||
39 | * Make sure the $field has a value equals to $value. |
||
40 | * |
||
41 | * @param Operand|string $field |
||
42 | * @param Operand|mixed $value |
||
43 | * @param string|null $context |
||
44 | */ |
||
45 | public function __construct($field, $value, ?string $context = null) |
||
51 | |||
52 | /** |
||
53 | * @param QueryBuilder $qb |
||
54 | * @param string $context |
||
55 | * |
||
56 | * @return string |
||
57 | */ |
||
58 | public function getFilter(QueryBuilder $qb, string $context): string |
||
72 | |||
73 | /** |
||
74 | * {@inheritdoc} |
||
75 | */ |
||
76 | public function filterCollection(iterable $collection, ?string $context = null): iterable |
||
88 | |||
89 | /** |
||
90 | * {@inheritdoc} |
||
91 | */ |
||
92 | public function isSatisfiedBy($candidate, ?string $context = null): bool |
||
100 | |||
101 | /** |
||
102 | * @param string|null $context |
||
103 | * |
||
104 | * @return string|null |
||
105 | */ |
||
106 | private function resolveContext(?string $context): ?string |
||
118 | |||
119 | /** |
||
120 | * @param mixed $field |
||
121 | * @param mixed $value |
||
122 | * |
||
123 | * @return bool |
||
124 | */ |
||
125 | private function contains($field, $value): bool |
||
133 | } |
||
134 |
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.