ProfileTransaction   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A sendRequest() 0 3 1
A request() 0 12 1
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\Zed\Ratepay\Business\Request\Service\Handler\Transaction;
9
10
use SprykerEco\Shared\Ratepay\RatepayConfig;
11
use SprykerEco\Zed\Ratepay\Business\Api\Constants as ApiConstants;
12
use SprykerEco\Zed\Ratepay\Business\Api\Model\Response\ProfileResponse;
13
use SprykerEco\Zed\Ratepay\Business\Request\TransactionHandlerAbstract;
14
15
class ProfileTransaction extends TransactionHandlerAbstract implements ProfileTransactionInterface
16
{
17
    public const TRANSACTION_TYPE = ApiConstants::REQUEST_MODEL_PROFILE;
18
19
    /**
20
     * @return \Generated\Shared\Transfer\RatepayResponseTransfer
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\RatepayResponseTransfer 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()
23
    {
24
        $request = $this->getMethodMapper(RatepayConfig::METHOD_SERVICE)
25
            ->profile();
0 ignored issues
show
Bug introduced by
The method profile() does not exist on SprykerEco\Zed\Ratepay\B...\Method\MethodInterface. ( Ignorable by Annotation )

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

25
            ->/** @scrutinizer ignore-call */ profile();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
26
27
        $response = $this->sendRequest((string)$request);
28
29
        $profileResponseTransfer = $this->converterFactory
30
            ->createProfileResponseConverter($response)
31
            ->convert();
32
33
        return $profileResponseTransfer;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $profileResponseTransfer returns the type Spryker\Shared\Kernel\Transfer\AbstractTransfer which is incompatible with the documented return type Generated\Shared\Transfer\RatepayResponseTransfer.
Loading history...
34
    }
35
36
    /**
37
     * @param string $request
38
     *
39
     * @return \SprykerEco\Zed\Ratepay\Business\Api\Model\Response\BaseResponse
40
     */
41
    protected function sendRequest($request)
42
    {
43
        return new ProfileResponse($this->executionAdapter->sendRequest($request));
44
    }
45
}
46