Passed
Push — feature/eco-2295/eco-2344-crea... ( 982ddf...5354d6 )
by Aleksey
01:04
created

FinishRequest::getFormParams()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 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\Zed\CrefoPayApi\Business\Request;
9
10
use Generated\Shared\Transfer\CrefoPayApiRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...foPayApiRequestTransfer 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\Zed\CrefoPayApi\Business\Builder\Request\CrefoPayApiRequestBuilderInterface;
12
use SprykerEco\Zed\CrefoPayApi\CrefoPayApiConfig;
13
14
class FinishRequest implements CrefoPayApiRequestInterface
15
{
16
    protected const REQUEST_TYPE = 'finish';
17
18
    /**
19
     * @var \SprykerEco\Zed\CrefoPayApi\Business\Builder\Request\CrefoPayApiRequestBuilderInterface
20
     */
21
    protected $requestBuilder;
22
23
    /**
24
     * @var \SprykerEco\Zed\CrefoPayApi\CrefoPayApiConfig
25
     */
26
    protected $config;
27
28
    /**
29
     * @param \SprykerEco\Zed\CrefoPayApi\Business\Builder\Request\CrefoPayApiRequestBuilderInterface $requestBuilder
30
     * @param \SprykerEco\Zed\CrefoPayApi\CrefoPayApiConfig $config
31
     */
32
    public function __construct(
33
        CrefoPayApiRequestBuilderInterface $requestBuilder,
34
        CrefoPayApiConfig $config
35
    ) {
36
        $this->requestBuilder = $requestBuilder;
37
        $this->config = $config;
38
    }
39
40
    /**
41
     * @param \Generated\Shared\Transfer\CrefoPayApiRequestTransfer $requestTransfer
42
     *
43
     * @return array
44
     */
45
    public function getFormParams(CrefoPayApiRequestTransfer $requestTransfer): array
46
    {
47
        return $this->requestBuilder->buildRequestPayload($requestTransfer);
48
    }
49
50
    /**
51
     * @return string
52
     */
53
    public function getUrl(): string
54
    {
55
        return $this->config->getFinishActionUrl();
56
    }
57
58
    /**
59
     * @return string
60
     */
61
    public function getRequestType(): string
62
    {
63
        return static::REQUEST_TYPE;
64
    }
65
}
66