FactFinderNgSuggestHandler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 10
c 2
b 0
f 0
dl 0
loc 22
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A executeQuery() 0 14 2
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Client\FactFinderNg\Handler;
9
10
use Elastica\Query;
11
use Exception;
12
use Spryker\Client\Search\Model\Handler\SearchHandlerInterface;
13
14
class FactFinderNgSuggestHandler extends FactFinderHandler implements SearchHandlerInterface
0 ignored issues
show
Deprecated Code introduced by
The interface Spryker\Client\Search\Mo...\SearchHandlerInterface has been deprecated: Will be removed without replacement. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

14
class FactFinderNgSuggestHandler extends FactFinderHandler implements /** @scrutinizer ignore-deprecated */ SearchHandlerInterface

This interface has been deprecated. The supplier of the interface has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the interface will be removed and what other interface to use instead.

Loading history...
15
{
16
    /**
17
     * @param \Elastica\Query $query
18
     * @param array $requestParameters
19
     *
20
     * @return array
21
     */
22
    protected function executeQuery(Query $query, array $requestParameters): array
23
    {
24
        $searchResult = [];
25
26
        try {
27
            $requestTransfer = $this->requestMapper->mapSuggestionRequest($requestParameters);
28
            $response = $this->adapterFactory->createFactFinderNgSuggestionAdapter()->sendRequest($requestTransfer);
29
            $responseTransfer = $this->responseParser->parseResponse($response);
30
            $searchResult = $responseTransfer->getBody();
31
        } catch (Exception $exception) {
32
            $this->throwSearchException($exception, $query);
33
        }
34
35
        return $searchResult;
36
    }
37
}
38