BraintreeToRefundFacadeBridge   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 34
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A saveRefund() 0 3 1
A __construct() 0 3 1
A calculateRefund() 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\Zed\Braintree\Dependency\Facade;
9
10
use Generated\Shared\Transfer\RefundTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\RefundTransfer 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 Orm\Zed\Sales\Persistence\SpySalesOrder;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\Sales\Persistence\SpySalesOrder 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
13
class BraintreeToRefundFacadeBridge implements BraintreeToRefundFacadeInterface
14
{
15
    /**
16
     * @var \Spryker\Zed\Refund\Business\RefundFacadeInterface
17
     */
18
    protected $refundFacade;
19
20
    /**
21
     * @param \Spryker\Zed\Refund\Business\RefundFacadeInterface $refundFacade
22
     */
23
    public function __construct($refundFacade)
24
    {
25
        $this->refundFacade = $refundFacade;
26
    }
27
28
    /**
29
     * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem[] $salesOrderItems
30
     * @param \Orm\Zed\Sales\Persistence\SpySalesOrder $salesOrderEntity
31
     *
32
     * @return \Generated\Shared\Transfer\RefundTransfer
33
     */
34
    public function calculateRefund(array $salesOrderItems, SpySalesOrder $salesOrderEntity)
35
    {
36
        return $this->refundFacade->calculateRefund($salesOrderItems, $salesOrderEntity);
37
    }
38
39
    /**
40
     * @param \Generated\Shared\Transfer\RefundTransfer $refundTransfer
41
     *
42
     * @return bool
43
     */
44
    public function saveRefund(RefundTransfer $refundTransfer)
45
    {
46
        return $this->refundFacade->saveRefund($refundTransfer);
47
    }
48
}
49