RequestAmountCalculator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 24
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
/**
4
 * Apache OSL-2
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\AmazonPay\Business\Payment;
9
10
use Orm\Zed\Sales\Persistence\SpySalesOrder;
11
use SprykerEco\Zed\AmazonPay\Dependency\Facade\AmazonPayToOmsInterface;
12
13
class RequestAmountCalculator implements RequestAmountCalculatorInterface
14
{
15
    /**
16
     * @var \SprykerEco\Zed\AmazonPay\Dependency\Facade\AmazonPayToOmsInterface
17
     */
18
    protected $omsFacade;
19
20
    /**
21
     * @param \SprykerEco\Zed\AmazonPay\Dependency\Facade\AmazonPayToOmsInterface $omsFacade
22
     */
23
    public function __construct(AmazonPayToOmsInterface $omsFacade)
24
    {
25
        $this->omsFacade = $omsFacade;
26
    }
27
28
    /**
29
     * @param \Orm\Zed\Sales\Persistence\SpySalesOrder $orderEntity
30
     * @param string $itemsFlag
31
     *
32
     * @return bool
33
     */
34
    public function shouldChargeShipping(SpySalesOrder $orderEntity, $itemsFlag)
35
    {
36
        return $this->omsFacade->isOrderFlaggedAll($orderEntity->getIdSalesOrder(), $itemsFlag);
37
    }
38
}
39