SearchImportTrigger::trigger()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 0
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\ImportTrigger;
9
10
use Generated\Shared\Transfer\FactFinderNgResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...inderNgResponseTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use SprykerEco\Client\FactFinderNg\Api\Adapter\Http\Factory\AdapterFactoryInterface;
12
use SprykerEco\Client\FactFinderNg\Mapper\Request\FactFinderNgRequestMapperInterface;
13
use SprykerEco\Client\FactFinderNg\Parser\ResponseParserInterface;
14
15
class SearchImportTrigger implements ImportTriggerInterface
16
{
17
    /**
18
     * @var \SprykerEco\Client\FactFinderNg\Mapper\Request\FactFinderNgRequestMapperInterface
19
     */
20
    protected $requestMapper;
21
22
    /**
23
     * @var \SprykerEco\Client\FactFinderNg\Parser\ResponseParserInterface
24
     */
25
    protected $responseParser;
26
27
    /**
28
     * @var \SprykerEco\Client\FactFinderNg\Api\Adapter\Http\Factory\AdapterFactoryInterface
29
     */
30
    protected $adapterFactory;
31
32
    /**
33
     * @param \SprykerEco\Client\FactFinderNg\Mapper\Request\FactFinderNgRequestMapperInterface $requestMapper
34
     * @param \SprykerEco\Client\FactFinderNg\Parser\ResponseParserInterface $responseParser
35
     * @param \SprykerEco\Client\FactFinderNg\Api\Adapter\Http\Factory\AdapterFactoryInterface $adapterFactory
36
     */
37
    public function __construct(
38
        FactFinderNgRequestMapperInterface $requestMapper,
39
        ResponseParserInterface $responseParser,
40
        AdapterFactoryInterface $adapterFactory
41
    ) {
42
        $this->requestMapper = $requestMapper;
43
        $this->responseParser = $responseParser;
44
        $this->adapterFactory = $adapterFactory;
45
    }
46
47
    /**
48
     * @return \Generated\Shared\Transfer\FactFinderNgResponseTransfer
49
     */
50
    public function trigger(): FactFinderNgResponseTransfer
51
    {
52
        $requestTransfer = $this->requestMapper->mapTriggerSearchImportRequest();
53
        $response = $this->adapterFactory->createFactFinderImportSearchAdapter()->sendRequest($requestTransfer);
54
55
        return $this->responseParser->parseResponse($response);
56
    }
57
}
58