Passed
Push — feature/ECO-808-scrutinizer ( 956529...82fb0b )
by Andrey
05:28 queued 01:30
created

RequestAmountCalculator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A shouldChargeShipping() 0 3 1
1
<?php
2
3
namespace SprykerEco\Zed\Amazonpay\Business\Payment;
4
5
use Orm\Zed\Sales\Persistence\SpySalesOrder;
1 ignored issue
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...
6
use SprykerEco\Zed\Amazonpay\Dependency\Facade\AmazonpayToOmsInterface;
7
8
class RequestAmountCalculator implements RequestAmountCalculatorInterface
9
{
10
11
    /**
12
     * @var \SprykerEco\Zed\Amazonpay\Dependency\Facade\AmazonpayToOmsInterface
13
     */
14
    protected $omsFacade;
15
16
    /**
17
     * @param \SprykerEco\Zed\Amazonpay\Dependency\Facade\AmazonpayToOmsInterface $omsFacade
18
     */
19
    public function __construct(AmazonpayToOmsInterface $omsFacade)
20
    {
21
        $this->omsFacade = $omsFacade;
22
    }
23
24
    /**
25
     * @param \Orm\Zed\Sales\Persistence\SpySalesOrder $orderEntity
26
     * @param string $itemsFlag
27
     *
28
     * @return bool
29
     */
30
    public function shouldChargeShipping(SpySalesOrder $orderEntity, $itemsFlag)
31
    {
32
        return $this->omsFacade->isOrderFlaggedAll($orderEntity->getIdSalesOrder(), $itemsFlag);
33
    }
34
35
}
36