@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | /** |
5 | 5 | * Alter the query or add to it, perhaps for example adding aggregation |
6 | 6 | * @param Elastic\Query &$query query object from Elastica |
7 | - * @return [type] [description] |
|
7 | + * @return void [description] |
|
8 | 8 | */ |
9 | 9 | public function augmentQuery(&$query); |
10 | 10 | |
@@ -12,6 +12,7 @@ discard block |
||
12 | 12 | * Update filters, perhaps remaps them, prior to performing a search. |
13 | 13 | * This allows for aggregation values to be updated prior to rendering. |
14 | 14 | * @param array &$filters array of key/value pairs for query filtering |
15 | + * @return void |
|
15 | 16 | */ |
16 | 17 | public function updateFilters(&$filters); |
17 | 18 | |
@@ -19,7 +20,7 @@ discard block |
||
19 | 20 | * Manipulate the array of aggregations post search butprior to rendering |
20 | 21 | * them in a template. |
21 | 22 | * @param [type] &$aggs [description] |
22 | - * @return [type] [description] |
|
23 | + * @return void [description] |
|
23 | 24 | */ |
24 | 25 | public function updateAggregation(&$aggs); |
25 | 26 |
@@ -62,6 +62,9 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | |
65 | + /** |
|
66 | + * @param boolean $newShowResultsForEmptyQuery |
|
67 | + */ |
|
65 | 68 | public function setShowResultsForEmptyQuery($newShowResultsForEmptyQuery) { |
66 | 69 | $this->showResultsForEmptyQuery = $newShowResultsForEmptyQuery; |
67 | 70 | } |
@@ -72,11 +75,17 @@ discard block |
||
72 | 75 | } |
73 | 76 | |
74 | 77 | |
78 | + /** |
|
79 | + * @param integer $newPageLength |
|
80 | + */ |
|
75 | 81 | public function setPageLength($newPageLength) { |
76 | 82 | $this->pageLength = $newPageLength; |
77 | 83 | } |
78 | 84 | |
79 | 85 | |
86 | + /** |
|
87 | + * @param integer $newStart |
|
88 | + */ |
|
80 | 89 | public function setStart($newStart) { |
81 | 90 | $this->start = $newStart; |
82 | 91 | } |
@@ -317,6 +326,9 @@ discard block |
||
317 | 326 | } |
318 | 327 | |
319 | 328 | |
329 | + /** |
|
330 | + * @param Query $query |
|
331 | + */ |
|
320 | 332 | private function addAggregation(&$query) { |
321 | 333 | // aggregation (optional) |
322 | 334 | if ($this->manipulatorInstance) { |
@@ -250,6 +250,9 @@ |
||
250 | 250 | } |
251 | 251 | |
252 | 252 | |
253 | + /** |
|
254 | + * @return integer |
|
255 | + */ |
|
253 | 256 | public function getTotalItems() { |
254 | 257 | $this->getResults(); |
255 | 258 | return $this->TotalItems; |
@@ -1036,6 +1036,7 @@ |
||
1036 | 1036 | /** |
1037 | 1037 | * Test searching |
1038 | 1038 | * http://stackoverflow.com/questions/28305250/elasticsearch-customize-score-for-synonyms-stemming |
1039 | + * @param string $queryText |
|
1039 | 1040 | */ |
1040 | 1041 | private function search($queryText,$fields = array('Title' => 1, 'Description' => 1), |
1041 | 1042 | $filters = array()) { |
@@ -153,6 +153,9 @@ |
||
153 | 153 | |
154 | 154 | /** |
155 | 155 | * Simulate a call to Elastica to get suggestions for a given phrase |
156 | + * @param string $phrase |
|
157 | + * @param string $suggestion |
|
158 | + * @param string $highlightedSuggestion |
|
156 | 159 | * @return [type] [description] |
157 | 160 | */ |
158 | 161 | private function getSuggestionArray($phrase, $suggestion, $highlightedSuggestion) { |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * Note: characters are stripped from the content; make sure that your assertions take this into account. |
103 | 103 | * |
104 | 104 | * @param string $selector A basic CSS selector, e.g. 'li.jobs h3' |
105 | - * @param array|string $expectedMatches The content of at least one of the matched tags |
|
105 | + * @param integer $index |
|
106 | 106 | * @throws PHPUnit_Framework_AssertionFailedError |
107 | 107 | * @return boolean |
108 | 108 | */ |
@@ -133,6 +133,12 @@ discard block |
||
133 | 133 | /* |
134 | 134 | Check all the nodes matching the selector for attribute name = expected value |
135 | 135 | */ |
136 | + |
|
137 | + /** |
|
138 | + * @param string $selector |
|
139 | + * @param string $attributeName |
|
140 | + * @param string $expectedValue |
|
141 | + */ |
|
136 | 142 | public function assertAttributeHasExactValue($selector, $attributeName, $expectedValue) { |
137 | 143 | $items = $this->cssParser()->getBySelector($selector); |
138 | 144 | foreach ($items as $item) { |
@@ -141,6 +147,9 @@ discard block |
||
141 | 147 | } |
142 | 148 | |
143 | 149 | |
150 | + /** |
|
151 | + * @param string $selector |
|
152 | + */ |
|
144 | 153 | public function assertAttributesHaveExactValues($selector, $expectedValues) { |
145 | 154 | $attributeNames = array_keys($expectedValues); |
146 | 155 | $items = $this->cssParser()->getBySelector($selector); |
@@ -154,6 +163,10 @@ discard block |
||
154 | 163 | } |
155 | 164 | |
156 | 165 | |
166 | + /** |
|
167 | + * @param string $selector |
|
168 | + * @param integer $expectedAmount |
|
169 | + */ |
|
157 | 170 | public function assertNumberOfNodes($selector, $expectedAmount) { |
158 | 171 | $items = $this->cssParser()->getBySelector($selector); |
159 | 172 | foreach ($items as $item) { |
@@ -106,6 +106,10 @@ |
||
106 | 106 | } |
107 | 107 | |
108 | 108 | |
109 | + /** |
|
110 | + * @param string $fieldName |
|
111 | + * @param string $message |
|
112 | + */ |
|
109 | 113 | private function checkForError($fieldName, $badValue, $message) { |
110 | 114 | $this->ElasticSearchPage->$fieldName = $badValue; |
111 | 115 |
@@ -132,6 +132,10 @@ discard block |
||
132 | 132 | } |
133 | 133 | |
134 | 134 | |
135 | + /** |
|
136 | + * @param integer $depth |
|
137 | + * @param string $parentKey |
|
138 | + */ |
|
135 | 139 | private function recurseArrayAssertion($toAssert, $depth, $parentKey) { |
136 | 140 | $prefix = str_repeat("\t",$depth); |
137 | 141 | echo "\t{$prefix}'$parentKey' => array(\n"; |
@@ -160,6 +164,10 @@ discard block |
||
160 | 164 | /* |
161 | 165 | Helper methods for testing CMS fields |
162 | 166 | */ |
167 | + |
|
168 | + /** |
|
169 | + * @param string $tabName |
|
170 | + */ |
|
163 | 171 | public function checkTabExists($fields, $tabName) { |
164 | 172 | echo "Searching for tab $tabName\n"; |
165 | 173 | $tab = $fields->findOrMakeTab("Root.{$tabName}"); |
@@ -184,6 +192,9 @@ discard block |
||
184 | 192 | } |
185 | 193 | |
186 | 194 | |
195 | + /** |
|
196 | + * @param string $fieldName |
|
197 | + */ |
|
187 | 198 | public function checkFieldExists($tab,$fieldName) { |
188 | 199 | $fields = $tab->Fields(); |
189 | 200 | echo "TAB:{$tab->Name}\n"; |
@@ -282,7 +282,6 @@ discard block |
||
282 | 282 | * to "auto-filter" all SELECT queries by this language. |
283 | 283 | * See {@link disable_locale_filter()} on how to override this behaviour temporarily. |
284 | 284 | * |
285 | - * @param string $lang New reading language. |
|
286 | 285 | */ |
287 | 286 | static function set_current_locale($locale) { |
288 | 287 | self::$current_locale = $locale; |
@@ -373,7 +372,7 @@ discard block |
||
373 | 372 | * Check if a given SQLQuery filters on the Locale field |
374 | 373 | * |
375 | 374 | * @param SQLQuery $query |
376 | - * @return boolean |
|
375 | + * @return boolean|null |
|
377 | 376 | */ |
378 | 377 | protected function filtersOnLocale($query) { |
379 | 378 | foreach($query->getWhere() as $condition) { |
@@ -536,7 +535,7 @@ discard block |
||
536 | 535 | * This ID might equal the record ID, but doesn't have to - |
537 | 536 | * it just points to one "original" record in the list. |
538 | 537 | * |
539 | - * @return int Numeric ID of the translationgroup in the <classname>_translationgroup table |
|
538 | + * @return false|string Numeric ID of the translationgroup in the <classname>_translationgroup table |
|
540 | 539 | */ |
541 | 540 | public function getTranslationGroup() { |
542 | 541 | if(!$this->owner->exists()) return false; |