@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Exception; |
6 | 6 | use GroupByInc\API\Util\SerializerFactory; |
7 | -use GroupByInc\API\Util\UriBuilder; |
|
8 | 7 | use Httpful\Mime; |
9 | 8 | use Httpful\Request; |
10 | 9 | use Httpful\Response; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | /** |
148 | 148 | * @param Response $response |
149 | 149 | * |
150 | - * @return bool|string |
|
150 | + * @return string|false |
|
151 | 151 | */ |
152 | 152 | private function getContentEncoding($response) |
153 | 153 | { |
@@ -161,6 +161,10 @@ discard block |
||
161 | 161 | return false; |
162 | 162 | } |
163 | 163 | |
164 | + /** |
|
165 | + * @param string $json |
|
166 | + * @param string $class |
|
167 | + */ |
|
164 | 168 | private function deserialize($json, $class) |
165 | 169 | { |
166 | 170 | $object = null; |
@@ -16,7 +16,6 @@ |
||
16 | 16 | use GroupByInc\API\Request\RefinementsRequest; |
17 | 17 | use GroupByInc\API\Request\Request; |
18 | 18 | use GroupByInc\API\Request\RestrictNavigation; |
19 | -use GroupByInc\API\Request\SelectedRefinement; |
|
20 | 19 | use GroupByInc\API\Request\SelectedRefinementRange; |
21 | 20 | use GroupByInc\API\Request\SelectedRefinementValue; |
22 | 21 | use GroupByInc\API\Request\Sort as RSort; |
@@ -428,6 +428,9 @@ discard block |
||
428 | 428 | array_push($this->customUrlParams, $param); |
429 | 429 | } |
430 | 430 | |
431 | + /** |
|
432 | + * @param string|null $refinementString |
|
433 | + */ |
|
431 | 434 | public function splitRefinements($refinementString) |
432 | 435 | { |
433 | 436 | if (StringUtils::isNotBlank($refinementString)) { |
@@ -875,7 +878,7 @@ discard block |
||
875 | 878 | /** |
876 | 879 | * @param MBias $bias |
877 | 880 | * |
878 | - * @return Bias |
|
881 | + * @return MBias |
|
879 | 882 | */ |
880 | 883 | protected static function convertBias($bias) |
881 | 884 | { |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use GroupByInc\API\Model\Navigation; |
6 | 6 | use GroupByInc\API\Model\Refinement\Type; |
7 | -use GroupByInc\API\Model\SelectedRefinement; |
|
8 | 7 | use GroupByInc\API\Model\SelectedRefinementValue; |
9 | 8 | use GroupByInc\API\Query; |
10 | 9 | use GroupByInc\API\Symbol; |
@@ -342,6 +342,9 @@ discard block |
||
342 | 342 | return $lastSegment; |
343 | 343 | } |
344 | 344 | |
345 | + /** |
|
346 | + * @param string $pathSegmentLookup |
|
347 | + */ |
|
345 | 348 | private function removeUnusedPathSegments(array &$pathSegments, $pathSegmentLookup) |
346 | 349 | { |
347 | 350 | while (count($pathSegments) > strlen($pathSegmentLookup)) { |
@@ -389,6 +392,9 @@ discard block |
||
389 | 392 | } |
390 | 393 | } |
391 | 394 | |
395 | + /** |
|
396 | + * @param string $token |
|
397 | + */ |
|
392 | 398 | private function getFieldName($token) |
393 | 399 | { |
394 | 400 | $mapping = $this->tokenToName[$token]; |
@@ -149,7 +149,7 @@ |
||
149 | 149 | |
150 | 150 | /** |
151 | 151 | * @param UrlReplacement[] $replacements |
152 | - * @return string |
|
152 | + * @return StringBuilder |
|
153 | 153 | */ |
154 | 154 | public static function buildQueryString(array $replacements) |
155 | 155 | { |
@@ -71,6 +71,10 @@ |
||
71 | 71 | $this->string = $front . $back; |
72 | 72 | } |
73 | 73 | |
74 | + /** |
|
75 | + * @param integer $index |
|
76 | + * @param integer $length |
|
77 | + */ |
|
74 | 78 | public function delete($index, $length = null) |
75 | 79 | { |
76 | 80 | if ($length != null) { |
@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace GroupByInc\API\Url; |
4 | 4 | |
5 | -use GroupByInc\API\Model\SelectedRefinement; |
|
6 | 5 | use GroupByInc\API\Util\StringBuilder; |
7 | 6 | |
8 | 7 | class UrlReplacementRule |
@@ -18,7 +18,6 @@ |
||
18 | 18 | use GroupByInc\API\Model\RichContentZone; |
19 | 19 | use GroupByInc\API\Model\Sort; |
20 | 20 | use GroupByInc\API\Model\Template; |
21 | -use GroupByInc\API\Model\Zone; |
|
22 | 21 | use GroupByInc\API\Request\Bias; |
23 | 22 | use GroupByInc\API\Request\Bias\Strength; |
24 | 23 | use GroupByInc\API\Request\Biasing; |
@@ -18,6 +18,9 @@ discard block |
||
18 | 18 | $this->beautifier->clearSavedFields(); |
19 | 19 | } |
20 | 20 | |
21 | + /** |
|
22 | + * @param string $identifier |
|
23 | + */ |
|
21 | 24 | private function getBeautifier($identifier) |
22 | 25 | { |
23 | 26 | $beautifiers = UrlBeautifier::getUrlBeautifiers(); |
@@ -203,6 +206,10 @@ discard block |
||
203 | 206 | $this->assertNavigation("height", "=20in", $navigations[1]); |
204 | 207 | } |
205 | 208 | |
209 | + /** |
|
210 | + * @param string $expectedNavName |
|
211 | + * @param string $expectedValue |
|
212 | + */ |
|
206 | 213 | public function assertNavigation($expectedNavName, $expectedValue, Navigation $navigation) |
207 | 214 | { |
208 | 215 | $this->assertEquals($expectedNavName, $navigation->getName()); |
@@ -284,6 +291,10 @@ discard block |
||
284 | 291 | $this->assertFromUrl("/aoeu/laptop/MAGNOLIA+HOME+THEATRE/qd/index.html", null, "MAGNOLIA HOME THEATRE"); |
285 | 292 | } |
286 | 293 | |
294 | + /** |
|
295 | + * @param string $url |
|
296 | + * @param null|string $searchString |
|
297 | + */ |
|
287 | 298 | private function assertFromUrl($url, $searchString) |
288 | 299 | { |
289 | 300 | $query = $this->beautifier->fromUrl($url); |
@@ -324,6 +335,10 @@ discard block |
||
324 | 335 | ->setAppend("/index.html"); |
325 | 336 | } |
326 | 337 | |
338 | + /** |
|
339 | + * @param string|null $searchString |
|
340 | + * @param null|string $refinementString |
|
341 | + */ |
|
327 | 342 | private function assertToAndFromUrl($searchString, $refinementString) |
328 | 343 | { |
329 | 344 | $url = $this->beautifier->toUrl($searchString, $refinementString); |
@@ -377,6 +392,9 @@ discard block |
||
377 | 392 | $this->assertFailingQuery("/black+decker/q/index.html?z=2-B--"); |
378 | 393 | } |
379 | 394 | |
395 | + /** |
|
396 | + * @param string $uri |
|
397 | + */ |
|
380 | 398 | private function assertFailingQuery($uri) |
381 | 399 | { |
382 | 400 | try { |
@@ -121,6 +121,9 @@ discard block |
||
121 | 121 | $this->assertBadApply("abc12", new UrlReplacement(6, "3", OperationType::Insert)); |
122 | 122 | } |
123 | 123 | |
124 | + /** |
|
125 | + * @param string $input |
|
126 | + */ |
|
124 | 127 | private function assertBadApply($input, UrlReplacement $replacement) |
125 | 128 | { |
126 | 129 | $builder = new StringBuilder($input); |
@@ -128,6 +131,10 @@ discard block |
||
128 | 131 | $this->assertEquals($input, $builder); |
129 | 132 | } |
130 | 133 | |
134 | + /** |
|
135 | + * @param string $input |
|
136 | + * @param string $expected |
|
137 | + */ |
|
131 | 138 | private function assertApply($input, $expected, UrlReplacement $replacement) |
132 | 139 | { |
133 | 140 | $builder = new StringBuilder($input); |
@@ -156,6 +163,9 @@ discard block |
||
156 | 163 | } |
157 | 164 | } |
158 | 165 | |
166 | + /** |
|
167 | + * @param string $replacementString |
|
168 | + */ |
|
159 | 169 | private function assertToAndFromString($replacementString) |
160 | 170 | { |
161 | 171 | $replacement1 = UrlReplacement::fromString($replacementString); |