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

PurchaseContext::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
ccs 3
cts 3
cp 1
crap 1
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;
15
16
use Eccube\Entity\ItemHolderInterface;
17
use Eccube\Entity\Customer;
18
19
/**
20
 * PurchaseFlowの実行中コンテキスト.
21
 */
22
class PurchaseContext extends \SplObjectStorage
23
{
24
    private $user;
25
26
    private $originHolder;
27
28 288
    public function __construct(ItemHolderInterface $originHolder = null, Customer $user = null)
29
    {
30 288
        $this->originHolder = $originHolder;
31 288
        $this->user = $user;
32
    }
33
34
    /**
35
     * PurchaseFlow実行前の{@link ItemHolderInterface}を取得.
36
     *
37
     * @return ItemHolderInterface
38
     */
39 133
    public function getOriginHolder()
40
    {
41 133
        return $this->originHolder;
42
    }
43
44
    /**
45
     * 会員情報を取得.
46
     *
47
     * @return Customer
48
     */
49
    public function getUser()
50
    {
51
        return $this->user;
52
    }
53
}
54