1 | <?php |
||
37 | class SearchRequestBuilder |
||
38 | { |
||
39 | |||
40 | /** |
||
41 | * @var TypoScriptConfiguration |
||
42 | */ |
||
43 | protected $typoScriptConfiguration; |
||
44 | |||
45 | /** |
||
46 | * @var FrontendUserSession |
||
47 | */ |
||
48 | protected $session = null; |
||
49 | |||
50 | /** |
||
51 | * SearchRequestBuilder constructor. |
||
52 | * @param TypoScriptConfiguration $typoScriptConfiguration |
||
53 | * @param FrontendUserSession $frontendUserSession |
||
54 | */ |
||
55 | 33 | public function __construct(TypoScriptConfiguration $typoScriptConfiguration, FrontendUserSession $frontendUserSession = null) |
|
60 | |||
61 | /** |
||
62 | * @param array $controllerArguments |
||
63 | * @param int $pageId |
||
64 | * @param int $languageId |
||
65 | * @return SearchRequest |
||
66 | */ |
||
67 | 32 | public function buildForSearch(array $controllerArguments, $pageId, $languageId) |
|
78 | |||
79 | /** |
||
80 | * Checks if the passed resultsPerPageValue is valid and applies it. If the perPage value was changed it is stored in |
||
81 | * the session and the current page is set to 0, since the pagination should start from the beginning then. |
||
82 | * |
||
83 | * @param SearchRequest $searchRequest |
||
84 | * @return SearchRequest |
||
85 | */ |
||
86 | 32 | protected function applyPassedResultsPerPage(SearchRequest $searchRequest) |
|
116 | |||
117 | /** |
||
118 | * Checks it the results should be hidden in the response. |
||
119 | * |
||
120 | * @param SearchRequest $searchRequest |
||
121 | * @return bool |
||
122 | */ |
||
123 | 32 | protected function shouldHideResultsFromInitialSearch(SearchRequest $searchRequest) |
|
131 | |||
132 | /** |
||
133 | * @param int $pageId |
||
134 | * @param int $languageId |
||
135 | * @return SearchRequest |
||
136 | */ |
||
137 | 1 | public function buildForFrequentSearches($pageId, $languageId) |
|
143 | |||
144 | /** |
||
145 | * @param array $controllerArguments |
||
146 | * @param string $rawUserQuery |
||
147 | * @param int $pageId |
||
148 | * @param int $languageId |
||
149 | * @return SearchRequest |
||
150 | */ |
||
151 | public function buildForSuggest(array $controllerArguments, $rawUserQuery, $pageId, $languageId) |
||
159 | |||
160 | /** |
||
161 | * Creates an instance of the SearchRequest. |
||
162 | * |
||
163 | * @param array $requestArguments |
||
164 | * @param int $pageId |
||
165 | * @param int $languageId |
||
166 | * @return SearchRequest |
||
167 | */ |
||
168 | 33 | protected function getRequest(array $requestArguments = [], $pageId = 0, $languageId = 0) |
|
173 | |||
174 | /** |
||
175 | * This methods sets the page argument to an expected positive integer value in the arguments array. |
||
176 | * |
||
177 | * @param array $arguments |
||
178 | * @return array |
||
179 | */ |
||
180 | 32 | protected function adjustPageArgumentToPositiveInteger(array $arguments) |
|
187 | } |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: