DenyPaymentClient   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 53
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A placeRequest() 0 6 2
1
<?php
2
/**
3
 * Copyright © Wirecard Brasil. All rights reserved.
4
 *
5
 * @author    Bruno Elisei <[email protected]>
6
 * See COPYING.txt for license details.
7
 */
8
9
declare(strict_types=1);
10
11
namespace Moip\Magento2\Gateway\Http\Client;
12
13
use Magento\Framework\HTTP\ZendClientFactory;
0 ignored issues
show
Bug introduced by
The type Magento\Framework\HTTP\ZendClientFactory 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...
14
use Magento\Framework\Serialize\Serializer\Json;
0 ignored issues
show
Bug introduced by
The type Magento\Framework\Serialize\Serializer\Json 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...
15
use Magento\Payment\Gateway\Http\ClientInterface;
0 ignored issues
show
Bug introduced by
The type Magento\Payment\Gateway\Http\ClientInterface 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...
16
use Magento\Payment\Gateway\Http\TransferInterface;
0 ignored issues
show
Bug introduced by
The type Magento\Payment\Gateway\Http\TransferInterface 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...
17
use Magento\Payment\Model\Method\Logger;
0 ignored issues
show
Bug introduced by
The type Magento\Payment\Model\Method\Logger 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...
18
use Moip\Magento2\Gateway\Config\Config;
19
20
/**
21
 * Class DenyPaymentClient - Returns authorization for order denial.
22
 */
23
class DenyPaymentClient implements ClientInterface
24
{
25
    /**
26
     * @var LoggerInterface
0 ignored issues
show
Bug introduced by
The type Moip\Magento2\Gateway\Http\Client\LoggerInterface 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...
27
     */
28
    private $logger;
29
30
    /**
31
     * @var ZendClientFactory
32
     */
33
    private $httpClientFactory;
34
35
    /**
36
     * @var Config
37
     */
38
    private $config;
39
40
    /**
41
     * @var Json
42
     */
43
    private $json;
44
45
    /**
46
     * @param Logger            $logger
47
     * @param ZendClientFactory $httpClientFactory
48
     * @param Config            $config
49
     * @param Json              $json
50
     */
51
    public function __construct(
52
        Logger $logger,
53
        ZendClientFactory $httpClientFactory,
54
        Config $config,
55
        Json $json
56
    ) {
57
        $this->config = $config;
58
        $this->httpClientFactory = $httpClientFactory;
59
        $this->logger = $logger;
60
        $this->json = $json;
61
    }
62
63
    /**
64
     * Places request to gateway.
65
     *
66
     * @param TransferInterface $transferObject
67
     *
68
     * @return array
69
     */
70
    public function placeRequest(TransferInterface $transferObject)
71
    {
72
        $request = $transferObject->getBody();
73
        if ($request) {
74
            return  [
75
                'RESULT_CODE' => 1,
76
            ];
77
        }
78
    }
79
}
80