1 | <?php |
||
20 | class SearchService |
||
21 | { |
||
22 | /** |
||
23 | * @var RenderContext |
||
24 | */ |
||
25 | protected $renderContext; |
||
26 | |||
27 | /** |
||
28 | * @var Container |
||
29 | */ |
||
30 | protected $container; |
||
31 | |||
32 | /** |
||
33 | * @var RequestStack |
||
34 | */ |
||
35 | protected $requestStack; |
||
36 | |||
37 | /** |
||
38 | * @var int |
||
39 | */ |
||
40 | protected $defaultPerPage; |
||
41 | |||
42 | /** |
||
43 | * @var array |
||
44 | */ |
||
45 | private $searchers; |
||
46 | |||
47 | /** |
||
48 | * @param int $defaultPerPage |
||
49 | */ |
||
50 | 2 | public function __construct(ContainerInterface $container, RequestStack $requestStack, $defaultPerPage = 10, array $searchers = []) |
|
58 | |||
59 | /** |
||
60 | * @param int $defaultPerPage |
||
61 | */ |
||
62 | public function setDefaultPerPage($defaultPerPage) |
||
66 | |||
67 | /** |
||
68 | * @return RenderContext |
||
69 | */ |
||
70 | public function getRenderContext() |
||
74 | |||
75 | /** |
||
76 | * @param RenderContext $renderContext |
||
77 | */ |
||
78 | public function setRenderContext($renderContext) |
||
82 | |||
83 | /** |
||
84 | * @return int |
||
85 | */ |
||
86 | 1 | public function getDefaultPerPage() |
|
90 | |||
91 | /** |
||
92 | * @return Container |
||
93 | */ |
||
94 | public function getContainer() |
||
98 | |||
99 | /** |
||
100 | * @param Container $container |
||
101 | */ |
||
102 | public function setContainer($container) |
||
106 | |||
107 | /** |
||
108 | * @return Request |
||
109 | */ |
||
110 | public function getRequest() |
||
114 | |||
115 | /** |
||
116 | * @return Pagerfanta |
||
117 | */ |
||
118 | 2 | public function search() |
|
155 | |||
156 | 1 | protected function applySearchParams(AbstractElasticaSearcher $searcher, Request $request, RenderContext $context) |
|
179 | |||
180 | /** |
||
181 | * Currently we just search for a complete match... |
||
182 | * |
||
183 | * @param string $query |
||
184 | * |
||
185 | * @return string |
||
186 | */ |
||
187 | 1 | protected function sanitizeSearchQuery($query) |
|
191 | |||
192 | /** |
||
193 | * @return int |
||
194 | */ |
||
195 | 2 | private function getRequestedPage(Request $request) |
|
204 | } |
||
205 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.