prepareProductCampaignAdapter()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Client\FactFinderSdk\Business\Api\Handler\Request;
9
10
use Generated\Shared\Transfer\FactFinderSdkProductCampaignRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...CampaignRequestTransfer 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\FactFinderSdk\Business\Api\ApiConstants;
12
13
class ProductCampaignRequest extends AbstractRequest implements ProductCampaignRequestInterface
14
{
15
    public const TRANSACTION_TYPE = ApiConstants::TRANSACTION_TYPE_PRODUCT_CAMPAIGN;
16
17
    /**
18
     * @param \Generated\Shared\Transfer\FactFinderSdkProductCampaignRequestTransfer $factFinderProductCampaignRequestTransfer
19
     *
20
     * @return \Generated\Shared\Transfer\FactFinderSdkProductCampaignResponseTransfer
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...ampaignResponseTransfer 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...
21
     */
22
    public function request(FactFinderSdkProductCampaignRequestTransfer $factFinderProductCampaignRequestTransfer)
23
    {
24
        $requestParameters = $this->factFinderConnector
25
            ->createRequestParametersFromProductCampaignRequestTransfer($factFinderProductCampaignRequestTransfer);
26
        $this->factFinderConnector->setRequestParameters($requestParameters);
27
28
        $productCampaignAdapter = $this->prepareProductCampaignAdapter();
29
30
        $responseTransfer = $this->converterFactory
31
            ->createProductCampaignResponseConverter($productCampaignAdapter)
32
            ->convert();
33
34
        return $responseTransfer;
35
    }
36
37
    /**
38
     * @return \FACTFinder\Adapter\ProductCampaign
39
     */
40
    protected function prepareProductCampaignAdapter()
41
    {
42
        $productCampaignAdapter = $this->factFinderConnector
43
            ->createProductCampaignAdapter();
44
45
        $productCampaignAdapter->makeProductCampaign();
46
47
        return $productCampaignAdapter;
48
    }
49
}
50