FinishRequest::getFormParams()   A
last analyzed

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\Request\Builder\CrefoPayApiRequestBuilderInterface;
12
use SprykerEco\Zed\CrefoPayApi\CrefoPayApiConfig;
13
14
class FinishRequest implements CrefoPayApiRequestInterface
15
{
16
    /**
17
     * @var string
18
     */
19
    protected const REQUEST_TYPE = 'finish';
20
21
    /**
22
     * @var \SprykerEco\Zed\CrefoPayApi\Business\Request\Builder\CrefoPayApiRequestBuilderInterface
23
     */
24
    protected $requestBuilder;
25
26
    /**
27
     * @var \SprykerEco\Zed\CrefoPayApi\CrefoPayApiConfig
28
     */
29
    protected $config;
30
31
    /**
32
     * @param \SprykerEco\Zed\CrefoPayApi\Business\Request\Builder\CrefoPayApiRequestBuilderInterface $requestBuilder
33
     * @param \SprykerEco\Zed\CrefoPayApi\CrefoPayApiConfig $config
34
     */
35
    public function __construct(
36
        CrefoPayApiRequestBuilderInterface $requestBuilder,
37
        CrefoPayApiConfig $config
38
    ) {
39
        $this->requestBuilder = $requestBuilder;
40
        $this->config = $config;
41
    }
42
43
    /**
44
     * @param \Generated\Shared\Transfer\CrefoPayApiRequestTransfer $requestTransfer
45
     *
46
     * @return array
47
     */
48
    public function getFormParams(CrefoPayApiRequestTransfer $requestTransfer): array
49
    {
50
        return $this->requestBuilder->buildRequestPayload($requestTransfer);
51
    }
52
53
    /**
54
     * @return string
55
     */
56
    public function getUrl(): string
57
    {
58
        return $this->config->getFinishApiEndpoint();
59
    }
60
61
    /**
62
     * @return string
63
     */
64
    public function getRequestType(): string
65
    {
66
        return static::REQUEST_TYPE;
67
    }
68
}
69