Completed
Push — master ( f7b119...9e4c7b )
by Yangsin
353:17 queued 347:09
created

EccubeServiceProvider   C

Complexity

Total Complexity 5

Size/Duplication

Total Lines 361
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 101

Test Coverage

Coverage 97.58%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 5
lcom 0
cbo 101
dl 0
loc 361
ccs 242
cts 248
cp 0.9758
rs 5
c 3
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
B register() 0 339 4
A boot() 0 3 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
25
namespace Eccube\ServiceProvider;
26
27
use Eccube\Application;
28
use Silex\Application as BaseApplication;
29
use Silex\ServiceProviderInterface;
30
31
class EccubeServiceProvider implements ServiceProviderInterface
0 ignored issues
show
introduced by
Missing class doc comment
Loading history...
32
{
33
    /**
34
     * Registers services on the given app.
35
     *
36
     * This method should only be used to configure services and parameters.
37
     * It should not get services.
38
     *
39
     * @param BaseApplication $app An Application instance
40
     */
41 1059
    public function register(BaseApplication $app)
42 37
    {
43
        // Service
44
        $app['eccube.service.system'] = $app->share(function () use ($app) {
45 2
            return new \Eccube\Service\SystemService($app);
0 ignored issues
show
Compatibility introduced by
$app of type object<Silex\Application> is not a sub-type of object<Eccube\Application>. It seems like you assume a child class of the class Silex\Application to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
46 1059
        });
47
        $app['view'] = $app->share(function () use ($app) {
48
            return $app['twig'];
49 1059
        });
50
        $app['eccube.service.cart'] = $app->share(function () use ($app) {
51 183
            return new \Eccube\Service\CartService($app);
0 ignored issues
show
Compatibility introduced by
$app of type object<Silex\Application> is not a sub-type of object<Eccube\Application>. It seems like you assume a child class of the class Silex\Application to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
52 1059
        });
53
        $app['eccube.service.order'] = $app->share(function () use ($app) {
54 64
            return new \Eccube\Service\OrderService($app);
0 ignored issues
show
Compatibility introduced by
$app of type object<Silex\Application> is not a sub-type of object<Eccube\Application>. It seems like you assume a child class of the class Silex\Application to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
Deprecated Code introduced by
The class Eccube\Service\OrderService has been deprecated with message: since 3.0.0, to be removed in 3.1

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
55 1059
        });
56
        $app['eccube.service.tax_rule'] = $app->share(function () use ($app) {
57 38
            return new \Eccube\Service\TaxRuleService($app['eccube.repository.tax_rule']);
58 1059
        });
59
        $app['eccube.service.plugin'] = $app->share(function () use ($app) {
60 148
            return new \Eccube\Service\PluginService($app);
61 1059
        });
62
        $app['eccube.service.mail'] = $app->share(function () use ($app) {
63 37
            return new \Eccube\Service\MailService($app);
0 ignored issues
show
Compatibility introduced by
$app of type object<Silex\Application> is not a sub-type of object<Eccube\Application>. It seems like you assume a child class of the class Silex\Application to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
64 1059
        });
65
        $app['eccube.service.csv.export'] = $app->share(function () use ($app) {
66 6
            $csvService = new \Eccube\Service\CsvExportService();
67 66
            $csvService->setEntityManager($app['orm.em']);
68 6
            $csvService->setConfig($app['config']);
69 6
            $csvService->setCsvRepository($app['eccube.repository.csv']);
70 6
            $csvService->setCsvTypeRepository($app['eccube.repository.master.csv_type']);
71 6
            $csvService->setOrderRepository($app['eccube.repository.order']);
72 6
            $csvService->setCustomerRepository($app['eccube.repository.customer']);
73 6
            $csvService->setProductRepository($app['eccube.repository.product']);
74
75 6
            return $csvService;
76 1059
        });
77
        $app['eccube.service.shopping'] = $app->share(function () use ($app) {
78 60
            return new \Eccube\Service\ShoppingService($app, $app['eccube.service.cart'], $app['eccube.service.order']);
0 ignored issues
show
Compatibility introduced by
$app of type object<Silex\Application> is not a sub-type of object<Eccube\Application>. It seems like you assume a child class of the class Silex\Application to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
79 1059
        });
80
81
        // Repository
82
        $app['eccube.repository.master.authority'] = $app->share(function () use ($app) {
83 208
            return $app['orm.em']->getRepository('Eccube\Entity\Master\Authority');
84 1059
        });
85
        $app['eccube.repository.master.tag'] = $app->share(function () use ($app) {
86 3
            return $app['orm.em']->getRepository('Eccube\Entity\Master\Tag');
87 1059
        });
88
        $app['eccube.repository.master.pref'] = $app->share(function () use ($app) {
89 315
            return $app['orm.em']->getRepository('Eccube\Entity\Master\Pref');
90 1059
        });
91
        $app['eccube.repository.master.sex'] = $app->share(function () use ($app) {
92 293
            return $app['orm.em']->getRepository('Eccube\Entity\Master\Sex');
93 1059
        });
94
        $app['eccube.repository.master.disp'] = $app->share(function () use ($app) {
95 238
            return $app['orm.em']->getRepository('Eccube\Entity\Master\Disp');
96 1059
        });
97
        $app['eccube.repository.master.product_type'] = $app->share(function () use ($app) {
98 244
            return $app['orm.em']->getRepository('Eccube\Entity\Master\ProductType');
99 1059
        });
100
        $app['eccube.repository.master.page_max'] = $app->share(function () use ($app) {
101 16
            return $app['orm.em']->getRepository('Eccube\Entity\Master\PageMax');
102 1059
        });
103
        $app['eccube.repository.master.order_status'] = $app->share(function () use ($app) {
104 3
            return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderStatus');
105 1059
        });
106
        $app['eccube.repository.master.device_type'] = $app->share(function () use ($app) {
107 207
            return $app['orm.em']->getRepository('Eccube\Entity\Master\DeviceType');
108 1059
        });
109
        $app['eccube.repository.master.csv_type'] = $app->share(function () use ($app) {
110 29
            return $app['orm.em']->getRepository('Eccube\Entity\Master\CsvType');
111 1059
        });
112
113
        $app['eccube.repository.delivery'] = $app->share(function () use ($app) {
114 119
            return $app['orm.em']->getRepository('Eccube\Entity\Delivery');
115 1059
        });
116
        $app['eccube.repository.delivery_date'] = $app->share(function () use ($app) {
117 226
            return $app['orm.em']->getRepository('Eccube\Entity\DeliveryDate');
118 1059
        });
119
        $app['eccube.repository.delivery_fee'] = $app->share(function () use ($app) {
120 171
            return $app['orm.em']->getRepository('Eccube\Entity\DeliveryFee');
121 1059
        });
122
        $app['eccube.repository.delivery_time'] = $app->share(function () use ($app) {
123
            return $app['orm.em']->getRepository('Eccube\Entity\DeliveryTime');
124 1059
        });
125
        $app['eccube.repository.payment'] = $app->share(function () use ($app) {
126 186
            return $app['orm.em']->getRepository('Eccube\Entity\Payment');
127 1059
        });
128
        $app['eccube.repository.payment_option'] = $app->share(function () use ($app) {
129 2
            return $app['orm.em']->getRepository('Eccube\Entity\PaymentOption');
130 1059
        });
131
        $app['eccube.repository.category'] = $app->share(function () use ($app) {
132 318
            $CategoryRepository = $app['orm.em']->getRepository('Eccube\Entity\Category');
133 318
            $CategoryRepository->setApplication($app);
134
135 318
            return $CategoryRepository;
136 1059
        });
137
        $app['eccube.repository.customer'] = $app->share(function () use ($app) {
138 305
            return $app['orm.em']->getRepository('Eccube\Entity\Customer');
139 1059
        });
140
        $app['eccube.repository.news'] = $app->share(function () use ($app) {
141 20
            return $app['orm.em']->getRepository('Eccube\Entity\News');
142 1059
        });
143
        $app['eccube.repository.mail_history'] = $app->share(function () use ($app) {
144 10
            return $app['orm.em']->getRepository('Eccube\Entity\MailHistory');
145 1059
        });
146
        $app['eccube.repository.member'] = $app->share(function () use ($app) {
147 489
            $memberRepository = $app['orm.em']->getRepository('Eccube\Entity\Member');
148 489
            $memberRepository->setEncoderFactorty($app['security.encoder_factory']);
149 489
            return $memberRepository;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
150 1059
        });
151
        $app['eccube.repository.order'] = $app->share(function () use ($app) {
152
            return $app['orm.em']->getRepository('Eccube\Entity\Order');
153 1059
        });
154
        $app['eccube.repository.product'] = $app->share(function () use ($app) {
155 70
            $productRepository = $app['orm.em']->getRepository('Eccube\Entity\Product');
156 70
            return $productRepository;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
157 1059
        });
158
        $app['eccube.repository.product_image'] = $app->share(function () use ($app) {
159
            return $app['orm.em']->getRepository('Eccube\Entity\ProductImage');
160 1059
        });
161
        $app['eccube.repository.product_class'] = $app->share(function () use ($app) {
162 34
            return $app['orm.em']->getRepository('Eccube\Entity\ProductClass');
163 1059
        });
164
        $app['eccube.repository.product_stock'] = $app->share(function () use ($app) {
165
            return $app['orm.em']->getRepository('Eccube\Entity\ProductStock');
166 1059
        });
167
        $app['eccube.repository.product_tag'] = $app->share(function () use ($app) {
168
            return $app['orm.em']->getRepository('Eccube\Entity\ProductTag');
169 1059
        });
170
        $app['eccube.repository.class_name'] = $app->share(function () use ($app) {
171 257
            return $app['orm.em']->getRepository('Eccube\Entity\ClassName');
172 1059
        });
173
        $app['eccube.repository.class_category'] = $app->share(function () use ($app) {
174 260
            return $app['orm.em']->getRepository('Eccube\Entity\ClassCategory');
175 1059
        });
176
        $app['eccube.repository.customer_favorite_product'] = $app->share(function () use ($app) {
177 569
            return $app['orm.em']->getRepository('Eccube\Entity\CustomerFavoriteProduct');
178 1059
        });
179
        $app['eccube.repository.base_info'] = $app->share(function () use ($app) {
180 669
            $BaseInfoRepository = $app['orm.em']->getRepository('Eccube\Entity\BaseInfo');
181 669
            $BaseInfoRepository->setApplication($app);
182
183 669
            return $BaseInfoRepository;
184 1059
        });
185
        $app['eccube.repository.tax_rule'] = $app->share(function () use ($app) {
186 206
            $taxRuleRepository = $app['orm.em']->getRepository('Eccube\Entity\TaxRule');
187 206
            $taxRuleRepository->setApplication($app);
188
189 206
            return $taxRuleRepository;
190 1059
        });
191
        $app['eccube.repository.page_layout'] = $app->share(function () use ($app) {
192 192
            $pageLayoutRepository = $app['orm.em']->getRepository('Eccube\Entity\PageLayout');
193 192
            $pageLayoutRepository->setApplication($app);
194
195 192
            return $pageLayoutRepository;
196 1059
        });
197
        $app['eccube.repository.block'] = $app->share(function () use ($app) {
198 14
            $blockRepository = $app['orm.em']->getRepository('Eccube\Entity\Block');
199 14
            $blockRepository->setApplication($app);
200
201 14
            return $blockRepository;
202 1059
        });
203
        $app['eccube.repository.order'] = $app->share(function () use ($app) {
204 136
            $orderRepository = $app['orm.em']->getRepository('Eccube\Entity\Order');
205 136
            $orderRepository->setApplication($app);
206
207 136
            return $orderRepository;
208 1059
        });
209
        $app['eccube.repository.customer_address'] = $app->share(function () use ($app) {
210 86
            return $app['orm.em']->getRepository('Eccube\Entity\CustomerAddress');
211 1059
        });
212
        $app['eccube.repository.shipping'] = $app->share(function () use ($app) {
213 4
            return $app['orm.em']->getRepository('Eccube\Entity\Shipping');
214 1059
        });
215
        $app['eccube.repository.customer_status'] = $app->share(function () use ($app) {
216 2
            return $app['orm.em']->getRepository('Eccube\Entity\Master\CustomerStatus');
217 1059
        });
218
        $app['eccube.repository.order_status'] = $app->share(function () use ($app) {
219 161
            return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderStatus');
220 1059
        });
221
        $app['eccube.repository.mail_template'] = $app->share(function () use ($app) {
222 12
            return $app['orm.em']->getRepository('Eccube\Entity\MailTemplate');
223 1059
        });
224
        $app['eccube.repository.csv'] = $app->share(function () use ($app) {
225 12
            return $app['orm.em']->getRepository('Eccube\Entity\Csv');
226 1059
        });
227
        $app['eccube.repository.template'] = $app->share(function () use ($app) {
228 1
            return $app['orm.em']->getRepository('Eccube\Entity\Template');
229 1059
        });
230
        $app['eccube.repository.authority_role'] = $app->share(function () use ($app) {
231 285
            return $app['orm.em']->getRepository('Eccube\Entity\AuthorityRole');
232 1059
        });
233
234
        $app['paginator'] = $app->protect(function () {
235 21
            return new \Knp\Component\Pager\Paginator();
236 1059
        });
237
238
        $app['eccube.repository.help'] = $app->share(function () use ($app) {
239 10
            return $app['orm.em']->getRepository('Eccube\Entity\Help');
240 1059
        });
241
        $app['eccube.repository.plugin'] = $app->share(function () use ($app) {
242 6
            return $app['orm.em']->getRepository('Eccube\Entity\Plugin');
243 1059
        });
244
        $app['eccube.repository.plugin_event_handler'] = $app->share(function () use ($app) {
245 1
            return $app['orm.em']->getRepository('Eccube\Entity\PluginEventHandler');
246 1059
        });
247
        // em
248 1059
        if (isset($app['orm.em'])) {
249
            $app['orm.em'] = $app->share($app->extend('orm.em', function (\Doctrine\ORM\EntityManager $em, \Silex\Application $app) {
250
                // tax_rule
251 1059
                $taxRuleRepository = $em->getRepository('Eccube\Entity\TaxRule');
252 1059
                $taxRuleRepository->setApplication($app);
253 1059
                $taxRuleService = new \Eccube\Service\TaxRuleService($taxRuleRepository);
0 ignored issues
show
Compatibility introduced by
$taxRuleRepository of type object<Doctrine\ORM\EntityRepository> is not a sub-type of object<Eccube\Repository\TaxRuleRepository>. It seems like you assume a child class of the class Doctrine\ORM\EntityRepository to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
254 1059
                $em->getEventManager()->addEventSubscriber(new \Eccube\Doctrine\EventSubscriber\TaxRuleEventSubscriber($taxRuleService));
255
256
                // save
257 1059
                $saveEventSubscriber = new \Eccube\Doctrine\EventSubscriber\SaveEventSubscriber($app);
0 ignored issues
show
Compatibility introduced by
$app of type object<Silex\Application> is not a sub-type of object<Eccube\Application>. It seems like you assume a child class of the class Silex\Application to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
258 1059
                $em->getEventManager()->addEventSubscriber($saveEventSubscriber);
259
260
                // clear cache
261 1059
                $clearCacheEventSubscriber = new \Eccube\Doctrine\EventSubscriber\ClearCacheEventSubscriber($app);
0 ignored issues
show
Compatibility introduced by
$app of type object<Silex\Application> is not a sub-type of object<Eccube\Application>. It seems like you assume a child class of the class Silex\Application to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
262 1059
                $em->getEventManager()->addEventSubscriber($clearCacheEventSubscriber);
263
264
                // filters
265 1059
                $config = $em->getConfiguration();
266 1059
                $config->addFilter("soft_delete", '\Eccube\Doctrine\Filter\SoftDeleteFilter');
267 1059
                $config->addFilter("nostock_hidden", '\Eccube\Doctrine\Filter\NoStockHiddenFilter');
268 1059
                $config->addFilter("incomplete_order_status_hidden", '\Eccube\Doctrine\Filter\OrderStatusFilter');
269 1059
                $em->getFilters()->enable('soft_delete');
270
271 1059
                return $em;
272 1059
            }));
273 1059
        }
274
275
        // Form\Type
276
        $app['form.type.extensions'] = $app->share($app->extend('form.type.extensions', function ($extensions) use ($app) {
277 568
            $extensions[] = new \Eccube\Form\Extension\HelpTypeExtension();
278 568
            $extensions[] = new \Eccube\Form\Extension\FreezeTypeExtension();
279
280 568
            return $extensions;
281 1059
        }));
282 1059
        $app['form.types'] = $app->share($app->extend('form.types', function ($types) use ($app) {
283 568
            $types[] = new \Eccube\Form\Type\NameType($app['config']);
284 568
            $types[] = new \Eccube\Form\Type\KanaType($app['config']);
285 568
            $types[] = new \Eccube\Form\Type\TelType($app['config']);
286 568
            $types[] = new \Eccube\Form\Type\FaxType(); // 削除予定
287 568
            $types[] = new \Eccube\Form\Type\ZipType($app['config']);
288 568
            $types[] = new \Eccube\Form\Type\AddressType($app['config']);
289 568
            $types[] = new \Eccube\Form\Type\RepeatedEmailType();
290 568
            $types[] = new \Eccube\Form\Type\RepeatedPasswordType($app['config']);
291 568
            $types[] = new \Eccube\Form\Type\PriceType($app['config']);
292
293 568
            $types[] = new \Eccube\Form\Type\MasterType();
294 568
            $types[] = new \Eccube\Form\Type\Master\JobType();
295 568
            $types[] = new \Eccube\Form\Type\Master\CustomerStatusType();
296 568
            $types[] = new \Eccube\Form\Type\Master\OrderStatusType();
297 568
            $types[] = new \Eccube\Form\Type\Master\CalcRuleType();
298 568
            $types[] = new \Eccube\Form\Type\Master\SexType();
299 568
            $types[] = new \Eccube\Form\Type\Master\DispType();
300 568
            $types[] = new \Eccube\Form\Type\Master\PrefType();
301 568
            $types[] = new \Eccube\Form\Type\Master\ProductTypeType();
302 568
            $types[] = new \Eccube\Form\Type\Master\ProductListMaxType();
303 568
            $types[] = new \Eccube\Form\Type\Master\ProductListOrderByType();
304 568
            $types[] = new \Eccube\Form\Type\Master\PageMaxType();
305 568
            $types[] = new \Eccube\Form\Type\Master\CsvType();
306 568
            $types[] = new \Eccube\Form\Type\Master\DeliveryDateType();
307 568
            $types[] = new \Eccube\Form\Type\Master\PaymentType();
308 568
            $types[] = new \Eccube\Form\Type\Master\MailTemplateType();
309 568
            $types[] = new \Eccube\Form\Type\Master\CategoryType();
310 568
            $types[] = new \Eccube\Form\Type\Master\TagType();
311
312 568
            $types[] = new \Eccube\Form\Type\CustomerType($app); // 削除予定
313
314 568
            if (isset($app['security']) && isset($app['eccube.repository.customer_favorite_product'])) {
315 568
                $types[] = new \Eccube\Form\Type\AddCartType($app['config'], $app['security'], $app['eccube.repository.customer_favorite_product']);
316 568
            }
317 568
            $types[] = new \Eccube\Form\Type\SearchProductType($app);
0 ignored issues
show
Compatibility introduced by
$app of type object<Silex\Application> is not a sub-type of object<Eccube\Application>. It seems like you assume a child class of the class Silex\Application to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
318 568
            $types[] = new \Eccube\Form\Type\SearchProductBlockType($app);
0 ignored issues
show
Compatibility introduced by
$app of type object<Silex\Application> is not a sub-type of object<Eccube\Application>. It seems like you assume a child class of the class Silex\Application to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
319 568
            $types[] = new \Eccube\Form\Type\OrderSearchType($app);
320 568
            $types[] = new \Eccube\Form\Type\ShippingItemType($app);
0 ignored issues
show
Compatibility introduced by
$app of type object<Silex\Application> is not a sub-type of object<Eccube\Application>. It seems like you assume a child class of the class Silex\Application to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
321 568
            $types[] = new \Eccube\Form\Type\ShippingMultipleType($app);
0 ignored issues
show
Compatibility introduced by
$app of type object<Silex\Application> is not a sub-type of object<Eccube\Application>. It seems like you assume a child class of the class Silex\Application to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
322 568
            $types[] = new \Eccube\Form\Type\ShippingMultipleItemType($app);
0 ignored issues
show
Compatibility introduced by
$app of type object<Silex\Application> is not a sub-type of object<Eccube\Application>. It seems like you assume a child class of the class Silex\Application to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
323 568
            $types[] = new \Eccube\Form\Type\ShoppingType();
324
325
            // front
326 568
            $types[] = new \Eccube\Form\Type\Front\EntryType($app['config']);
327 568
            $types[] = new \Eccube\Form\Type\Front\ContactType($app['config']);
328 568
            $types[] = new \Eccube\Form\Type\Front\NonMemberType($app['config']);
329 568
            $types[] = new \Eccube\Form\Type\Front\ShoppingShippingType();
330 568
            $types[] = new \Eccube\Form\Type\Front\CustomerAddressType($app['config']);
331 568
            $types[] = new \Eccube\Form\Type\Front\ForgotType();
332 568
            $types[] = new \Eccube\Form\Type\Front\CustomerLoginType($app['session']);
333
334
            // admin
335 568
            $types[] = new \Eccube\Form\Type\Admin\LoginType($app['session']);
336 568
            $types[] = new \Eccube\Form\Type\Admin\ChangePasswordType($app);
337 568
            $types[] = new \Eccube\Form\Type\Admin\ProductType($app);
338 568
            $types[] = new \Eccube\Form\Type\Admin\ProductClassType($app);
339 568
            $types[] = new \Eccube\Form\Type\Admin\SearchProductType($app);
340 568
            $types[] = new \Eccube\Form\Type\Admin\SearchCustomerType($app['config']);
341 568
            $types[] = new \Eccube\Form\Type\Admin\SearchOrderType($app['config']);
342 568
            $types[] = new \Eccube\Form\Type\Admin\CustomerType($app['config']);
343 568
            $types[] = new \Eccube\Form\Type\Admin\ClassNameType($app['config']);
344 568
            $types[] = new \Eccube\Form\Type\Admin\ClassCategoryType($app['config']);
345 568
            $types[] = new \Eccube\Form\Type\Admin\CategoryType($app['config']);
346 568
            $types[] = new \Eccube\Form\Type\Admin\MemberType($app['config']);
347 568
            $types[] = new \Eccube\Form\Type\Admin\AuthorityRoleType($app['config']);
348 568
            $types[] = new \Eccube\Form\Type\Admin\PageLayoutType();
349 568
            $types[] = new \Eccube\Form\Type\Admin\NewsType($app['config']);
350 568
            $types[] = new \Eccube\Form\Type\Admin\TemplateType($app['config']);
351 568
            $types[] = new \Eccube\Form\Type\Admin\SecurityType($app);
352 568
            $types[] = new \Eccube\Form\Type\Admin\CsvImportType($app);
353 568
            $types[] = new \Eccube\Form\Type\Admin\ShopMasterType($app['config']);
354 568
            $types[] = new \Eccube\Form\Type\Admin\TradelawType($app['config']);
355 568
            $types[] = new \Eccube\Form\Type\Admin\OrderType($app);
356 568
            $types[] = new \Eccube\Form\Type\Admin\OrderDetailType($app);
357 568
            $types[] = new \Eccube\Form\Type\Admin\ShippingType($app);
0 ignored issues
show
Compatibility introduced by
$app of type object<Silex\Application> is not a sub-type of object<Eccube\Application>. It seems like you assume a child class of the class Silex\Application to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
358 568
            $types[] = new \Eccube\Form\Type\Admin\ShipmentItemType($app);
359 568
            $types[] = new \Eccube\Form\Type\Admin\PaymentRegisterType();
360 568
            $types[] = new \Eccube\Form\Type\Admin\TaxRuleType();
361 568
            $types[] = new \Eccube\Form\Type\Admin\MainEditType($app);
362 568
            $types[] = new \Eccube\Form\Type\Admin\MailType();
363 568
            $types[] = new \Eccube\Form\Type\Admin\CustomerAgreementType($app);
364 568
            $types[] = new \Eccube\Form\Type\Admin\BlockType($app);
365 568
            $types[] = new \Eccube\Form\Type\Admin\DeliveryType();
366 568
            $types[] = new \Eccube\Form\Type\Admin\DeliveryFeeType();
367 568
            $types[] = new \Eccube\Form\Type\Admin\DeliveryTimeType($app['config']);
368 568
            $types[] = new \Eccube\Form\Type\Admin\LogType($app['config']);
369 568
            $types[] = new \Eccube\Form\Type\Admin\CacheType($app['config']);
370
371 568
            $types[] = new \Eccube\Form\Type\Admin\MasterdataType($app);
372 568
            $types[] = new \Eccube\Form\Type\Admin\MasterdataEditType($app);
373
374 568
            $types[] = new \Eccube\Form\Type\Admin\PluginLocalInstallType();
375 568
            $types[] = new \Eccube\Form\Type\Admin\PluginManagementType();
376
377 568
            return $types;
378 1059
        }));
379 1059
    }
380
381
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$app" missing
Loading history...
382
     * Bootstraps the application.
383
     *
384
     * This method is called after all services are registered
385
     * and should be used for "dynamic" configuration (whenever
386
     * a service must be requested).
387
     */
388 1059
    public function boot(BaseApplication $app)
389
    {
390 1059
    }
391
}
392