1 | <?php |
||
17 | class ChainSearch implements SearcherInterface |
||
18 | { |
||
19 | const MINIMUM_CELLS = 2; |
||
20 | |||
21 | /** |
||
22 | * @var CellInterface[] |
||
23 | */ |
||
24 | private $cells; |
||
25 | |||
26 | /** |
||
27 | * @param CellInterface[] $cells |
||
28 | */ |
||
29 | 9 | public function __construct(array $cells) |
|
34 | |||
35 | /** |
||
36 | * Will perform multiple sub-searches. |
||
37 | * Results from first search will be transformed and passed as CriteriaCollection |
||
38 | * to another sub-search. |
||
39 | * Whole process will return collection of results from each sub-search. |
||
40 | * |
||
41 | * @param CriteriaCollectionInterface $criteriaCollection |
||
42 | * |
||
43 | * @return ResultCollection |
||
44 | */ |
||
45 | 4 | public function search( |
|
69 | |||
70 | /** |
||
71 | * @param CellInterface[] $cells |
||
72 | * |
||
73 | * @throws \InvalidArgumentException |
||
74 | */ |
||
75 | 9 | private function validateCells(array $cells) |
|
94 | |||
95 | /** |
||
96 | * @param ResultCollection $result |
||
97 | * @param CellInterface $cell |
||
98 | * @param mixed $previousResults |
||
99 | * |
||
100 | * @return ResultCollection |
||
101 | */ |
||
102 | 4 | private function addResult( |
|
113 | } |
||
114 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: