OrderService   A
last analyzed

Complexity

Total Complexity 12

Size/Duplication

Total Lines 170
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 12
c 0
b 0
f 0
lcom 1
cbo 0
dl 0
loc 170
rs 10

12 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getTotalQuantity() 0 4 1
A getSubTotal() 0 4 1
A getTotalTax() 0 4 1
A getProductTypes() 0 4 1
A newOrder() 0 4 1
A registerPreOrderFromCartItems() 0 4 1
A getAmount() 0 4 1
A isOrderProduct() 0 4 1
A setOrderUpdate() 0 4 1
A setStockUpdate() 0 4 1
A setCustomerUpdate() 0 4 1
1
<?php
2
/*
3
 * This file is part of EC-CUBE
4
 *
5
 * Copyright(c) 2000-2015 LOCKON CO.,LTD. All Rights Reserved.
6
 *
7
 * http://www.lockon.co.jp/
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22
 */
23
24
namespace Eccube\Service;
25
26
use Eccube\Application;
27
use Eccube\Entity\Cart;
28
use Eccube\Entity\Customer;
29
use Eccube\Entity\Order;
30
31
/**
32
 * @deprecated since 3.0.0, to be removed in 3.1
33
 */
34
class OrderService
35
{
36
    /** @var \Eccube\Application */
37
    public $app;
38
39
    public function __construct(Application $app)
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
40
    {
41
        $this->app = $app;
42
    }
43
44
    /**
45
     * 合計数量を取得
46
     *
47
     * @param Order $Order
48
     * @return int
49
     * @deprecated since 3.0.0, to be removed in 3.1
50
     */
51
    public function getTotalQuantity(Order $Order)
52
    {
53
        return $Order->calculateTotalQuantity();
54
    }
55
56
    /**
57
     * 小計を取得
58
     *
59
     * @param Order $Order
60
     * @return int
61
     * @deprecated since 3.0.0, to be removed in 3.1
62
     */
63
    public function getSubTotal(Order $Order)
64
    {
65
        return $Order->calculateSubTotal();
66
    }
67
68
    /**
69
     * 消費税のみの小計を取得
70
     *
71
     * @param Order $Order
72
     * @return int
73
     * @deprecated since 3.0.0, to be removed in 3.1
74
     */
75
    public function getTotalTax(Order $Order)
76
    {
77
        return $Order->calculateTotalTax();
78
    }
79
80
    /**
81
     * 商品種別を取得
82
     *
83
     * @param Order $Order
84
     * @return array
85
     * @deprecated since 3.0.0, to be removed in 3.1
86
     */
87
    public function getProductTypes(Order $Order)
88
    {
89
        return $Order->getProductTypes();
90
    }
91
92
    /**
93
     * 下位互換用関数
94
     *
95
     * @return Order
96
     *
97
     * @see ShoppingService::newOrder()
98
     *
99
     * @deprecated since 3.0.0, to be removed in 3.1
100
     */
101
    public function newOrder()
102
    {
103
        return $this->app['eccube.service.shopping']->newOrder();
104
    }
105
106
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$cartItems" missing
Loading history...
introduced by
Doc comment for parameter "$preOrderId" missing
Loading history...
107
     * 下位互換用関数
108
     *
109
     * @param $cartItems
0 ignored issues
show
introduced by
Missing parameter name
Loading history...
110
     * @param Customer|null $Customer
111
     * @param $preOrderId
0 ignored issues
show
introduced by
Missing parameter name
Loading history...
112
     * @return Order
113
     *
114
     * @see ShoppingService::createOrder()
115
     *
116
     * @deprecated since 3.0.0, to be removed in 3.1
117
     */
118
    public function registerPreOrderFromCartItems($cartItems, Customer $Customer = null, $preOrderId)
0 ignored issues
show
Unused Code introduced by
The parameter $cartItems is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $preOrderId is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Coding Style introduced by
Parameters which have default values should be placed at the end.

If you place a parameter with a default value before a parameter with a default value, the default value of the first parameter will never be used as it will always need to be passed anyway:

// $a must always be passed; it's default value is never used.
function someFunction($a = 5, $b) { }
Loading history...
119
    {
120
        return $this->app['eccube.service.shopping']->createOrder($Customer);
121
    }
122
123
    /**
124
     * 下位互換用関数
125
     *
126
     * @param Order $Order
127
     * @param Cart $Cart
0 ignored issues
show
introduced by
Expected 2 spaces after parameter type; 1 found
Loading history...
128
     * @return Order
129
     *
130
     * @see ShoppingService::getAmount()
131
     *
132
     * @deprecated since 3.0.0, to be removed in 3.1
133
     */
134
    public function getAmount(Order $Order, Cart $Cart)
0 ignored issues
show
Unused Code introduced by
The parameter $Cart is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
135
    {
136
        return $this->app['eccube.service.shopping']->getAmount($Order);
137
    }
138
139
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$em" missing
Loading history...
140
     * 下位互換用関数
141
     *
142
     * @param $em トランザクション制御されているEntityManager
0 ignored issues
show
introduced by
Missing parameter name
Loading history...
143
     * @param Order $Order 受注情報
0 ignored issues
show
introduced by
Expected 57 spaces after parameter type; 1 found
Loading history...
144
     * @return bool true : 成功、false : 失敗
145
     *
146
     * @see ShoppingService::isOrderProduct()
147
     *
148
     * @deprecated since 3.0.0, to be removed in 3.1
149
     */
150
    public function isOrderProduct($em, Order $Order)
151
    {
152
        return $this->app['eccube.service.shopping']->isOrderProduct($em, $Order);
153
    }
154
155
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$em" missing
Loading history...
introduced by
Doc comment for parameter "$formData" missing
Loading history...
156
     * 下位互換用関数
157
     *
158
     * @param $em トランザクション制御されているEntityManager
0 ignored issues
show
introduced by
Missing parameter name
Loading history...
159
     * @param Order $Order 受注情報
0 ignored issues
show
introduced by
Expected 57 spaces after parameter type; 1 found
Loading history...
160
     * @param $formData フォームデータ
0 ignored issues
show
introduced by
Missing parameter name
Loading history...
161
     *
162
     * @see ShoppingService::setOrderUpdate()
163
     *
164
     * @deprecated since 3.0.0, to be removed in 3.1
165
     */
166
    public function setOrderUpdate($em, Order $Order, $formData)
0 ignored issues
show
Unused Code introduced by
The parameter $em is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
167
    {
168
        $this->app['eccube.service.shopping']->setOrderUpdate($Order, $formData);
169
    }
170
171
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$em" missing
Loading history...
172
     * 下位互換用関数
173
     *
174
     * @param $em トランザクション制御されているEntityManager
0 ignored issues
show
introduced by
Missing parameter name
Loading history...
175
     * @param Order $Order 受注情報
0 ignored issues
show
introduced by
Expected 57 spaces after parameter type; 1 found
Loading history...
176
     *
177
     * @see ShoppingService::setStockUpdate()
178
     *
179
     * @deprecated since 3.0.0, to be removed in 3.1
180
     */
181
    public function setStockUpdate($em, Order $Order)
182
    {
183
        $this->app['eccube.service.shopping']->setStockUpdate($em, $Order);
184
    }
185
186
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$em" missing
Loading history...
187
     * 下位互換用関数
188
     *
189
     * @param $em トランザクション制御されているEntityManager
0 ignored issues
show
introduced by
Missing parameter name
Loading history...
190
     * @param Order $Order 受注情報
0 ignored issues
show
introduced by
Expected 57 spaces after parameter type; 1 found
Loading history...
191
     * @param Customer $user ログインユーザ
0 ignored issues
show
introduced by
Expected 54 spaces after parameter type; 1 found
Loading history...
introduced by
Expected 2 spaces after parameter name; 1 found
Loading history...
192
     *
193
     * @see ShoppingService::setCustomerUpdate()
194
     *
195
     * @deprecated since 3.0.0, to be removed in 3.1
196
     */
197
    public function setCustomerUpdate($em, Order $Order, Customer $user)
0 ignored issues
show
Unused Code introduced by
The parameter $em is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
198
    {
199
        $this->app['eccube.service.shopping']->setCustomerUpdate($Order, $user);
200
    }
201
202
203
}
204