Passed
Pull Request — master (#17)
by Stanislav
10:22
created

FirstDataAuthorizeSessionParametersMapper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
dl 0
loc 32
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A mapFirstDataAuthorizeSessionParametersTransferToRestCheckoutDataResponseAttributesTransfer() 0 11 1
A __construct() 0 3 1
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\Glue\FirstData\Processor\Mapper;
9
10
use Generated\Shared\Transfer\RestCheckoutDataResponseAttributesTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...ponseAttributesTransfer 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 Generated\Shared\Transfer\RestCheckoutDataTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\RestCheckoutDataTransfer 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...
12
use SprykerEco\Client\FirstData\FirstDataClientInterface;
13
14
class FirstDataAuthorizeSessionParametersMapper implements FirstDataAuthorizeSessionParametersMapperInterface
15
{
16
    /**
17
     * @var \SprykerEco\Client\FirstData\FirstDataClientInterface
18
     */
19
    protected $firstDataClient;
20
21
    /**
22
     * @param \SprykerEco\Client\FirstData\FirstDataClientInterface $firstDataClient
23
     */
24
    public function __construct(FirstDataClientInterface $firstDataClient)
25
    {
26
        $this->firstDataClient = $firstDataClient;
27
    }
28
29
    /**
30
     * @param \Generated\Shared\Transfer\RestCheckoutDataResponseAttributesTransfer $restCheckoutDataResponseAttributesTransfer
31
     * @param \Generated\Shared\Transfer\RestCheckoutDataTransfer $restCheckoutDataTransfer
32
     *
33
     * @return \Generated\Shared\Transfer\RestCheckoutDataResponseAttributesTransfer
34
     */
35
    public function mapFirstDataAuthorizeSessionParametersTransferToRestCheckoutDataResponseAttributesTransfer(
36
        RestCheckoutDataResponseAttributesTransfer $restCheckoutDataResponseAttributesTransfer,
37
        RestCheckoutDataTransfer $restCheckoutDataTransfer
38
    ): RestCheckoutDataResponseAttributesTransfer {
39
        $firstDataApiResponseTransfer = $this->firstDataClient->getAuthorizeSessionResponse();
0 ignored issues
show
Bug introduced by
The call to SprykerEco\Client\FirstD...horizeSessionResponse() has too few arguments starting with customerTransfer. ( Ignorable by Annotation )

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

39
        /** @scrutinizer ignore-call */ 
40
        $firstDataApiResponseTransfer = $this->firstDataClient->getAuthorizeSessionResponse();

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
40
41
        $restCheckoutDataResponseAttributesTransfer->setFirstDataAuthorizeSessionParameters(
42
            $firstDataApiResponseTransfer->getAuthorizeSessionresponseOrFail()
43
        );
44
45
        return $restCheckoutDataResponseAttributesTransfer;
46
    }
47
}
48