Failed Conditions
Pull Request — experimental/sf (#3247)
by Kiyotaka
114:07 queued 103:28
created

OrderUpdateProcessor   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 83.33%

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 10
c 0
b 0
f 0
ccs 5
cts 6
cp 0.8333
wmc 3
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A commit() 0 7 2
1
<?php
2
3
/*
4
 * This file is part of EC-CUBE
5
 *
6
 * Copyright(c) LOCKON CO.,LTD. All Rights Reserved.
7
 *
8
 * http://www.lockon.co.jp/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Eccube\Service\PurchaseFlow\Processor;
15
16
use Eccube\Entity\ItemHolderInterface;
17
use Eccube\Entity\Order;
18
use Eccube\Service\PurchaseFlow\PurchaseContext;
19
use Eccube\Service\ShoppingService;
20
21
/**
22
 * 受注情報更新処理.
23
 */
24
class OrderUpdateProcessor extends AbstractPurchaseProcessor
25
{
26
    /**
27
     * @var ShoppingService
28
     */
29
    private $shoppingService;
30
31
    /**
32
     * OrderUpdateProcessor constructor.
33
     *
34
     * @param ShoppingService $shoppingService
35
     */
36 59
    public function __construct(ShoppingService $shoppingService)
37
    {
38 59
        $this->shoppingService = $shoppingService;
39
    }
40
41 6
    public function commit(ItemHolderInterface $target, PurchaseContext $context)
42
    {
43 6
        if (!$target instanceof Order) {
44
            return;
45
        }
46 6
        $this->shoppingService->setOrderUpdateData($target);
47
    }
48
}
49