TransferFactory::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
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
namespace Moip\Magento2\Gateway\Http;
10
11
use Magento\Payment\Gateway\Http\TransferBuilder;
0 ignored issues
show
Bug introduced by
The type Magento\Payment\Gateway\Http\TransferBuilder 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 Magento\Payment\Gateway\Http\TransferFactoryInterface;
0 ignored issues
show
Bug introduced by
The type Magento\Payment\Gateway\...ransferFactoryInterface 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...
13
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...
14
15
/**
16
 * Class TransferFactory - Factors data transfer.
17
 */
18
class TransferFactory implements TransferFactoryInterface
19
{
20
    /**
21
     * @var TransferBuilder
22
     */
23
    private $transferBuilder;
24
25
    /**
26
     * @param TransferBuilder $transferBuilder
27
     */
28
    public function __construct(
29
        TransferBuilder $transferBuilder
30
    ) {
31
        $this->transferBuilder = $transferBuilder;
32
    }
33
34
    /**
35
     * Builds gateway transfer object     *.
36
     *
37
     * @param array $request
38
     *
39
     * @return TransferInterface
40
     */
41
    public function create(array $request)
42
    {
43
        return $this->transferBuilder
44
            ->setBody($request)
45
            ->setMethod('POST')
46
            ->build();
47
    }
48
}
49