Passed
Pull Request — master (#365)
by Dmitry
21:01
created

ExampleProductSalePageClient   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 6
dl 0
loc 19
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A saleSearch() 0 8 1
1
<?php
2
3
/**
4
 * This file is part of the Spryker Commerce OS.
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace Pyz\Client\ExampleProductSalePage;
9
10
use Spryker\Client\Kernel\AbstractClient;
11
12
/**
13
 * @method \Pyz\Client\ExampleProductSalePage\ExampleProductSalePageFactory getFactory()
14
 */
15
class ExampleProductSalePageClient extends AbstractClient implements ExampleProductSalePageClientInterface
16
{
17
    /**
18
     * {@inheritDoc}
19
     *
20
     * @api
21
     *
22
     * @param array<mixed> $requestParameters
23
     *
24
     * @return array<mixed>
25
     */
26
    public function saleSearch(array $requestParameters = []): array
27
    {
28
        $searchQuery = $this->getFactory()->getSaleSearchQueryPlugin($requestParameters);
29
        $resultFormatters = $this->getFactory()->getSaleSearchResultFormatterPlugins();
30
31
        return $this->getFactory()
0 ignored issues
show
Deprecated Code introduced by
The function Spryker\Client\Search\Se...ientInterface::search() has been deprecated. ( Ignorable by Annotation )

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

31
        return /** @scrutinizer ignore-deprecated */ $this->getFactory()
Loading history...
Bug Best Practice introduced by
The expression return $this->getFactory...rs, $requestParameters) could return the type Elastica\ResultSet which is incompatible with the type-hinted return array. Consider adding an additional type-check to rule them out.
Loading history...
32
            ->getSearchClient()
33
            ->search($searchQuery, $resultFormatters, $requestParameters);
34
    }
35
}
36