Failed Conditions
Push — master ( faced6...c4ab7a )
by Kentaro
41:53
created

EccubeServiceProvider   C

Complexity

Total Complexity 5

Size/Duplication

Total Lines 343
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 96

Test Coverage

Coverage 14.43%

Importance

Changes 8
Bugs 0 Features 0
Metric Value
wmc 5
c 8
b 0
f 0
lcom 0
cbo 96
dl 0
loc 343
rs 5
ccs 14
cts 97
cp 0.1443

2 Methods

Rating   Name   Duplication   Size   Complexity  
B register() 0 321 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
     */
0 ignored issues
show
introduced by
Missing @return tag in function comment
Loading history...
41 676
    public function register(BaseApplication $app)
42
    {
43
        // Service
44
        $app['eccube.service.system'] = $app->share(function () use ($app) {
45
            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
        });
47
        $app['view'] = $app->share(function () use ($app) {
48
            return $app['twig'];
49
        });
50
        $app['eccube.service.cart'] = $app->share(function () use ($app) {
51
            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
        });
53
        $app['eccube.service.order'] = $app->share(function () use ($app) {
54
            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
        });
56
        $app['eccube.service.tax_rule'] = $app->share(function () use ($app) {
57
            return new \Eccube\Service\TaxRuleService($app['eccube.repository.tax_rule']);
58
        });
59
        $app['eccube.service.plugin'] = $app->share(function () use ($app) {
60
            return new \Eccube\Service\PluginService($app);
61
        });
62
        $app['eccube.service.mail'] = $app->share(function () use ($app) {
63
            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
        });
65
        $app['eccube.service.csv.export'] = $app->share(function () use ($app) {
66
            $csvService = new \Eccube\Service\CsvExportService();
67
            $csvService->setConfig($app['config']);
68
            $csvService->setCsvRepository($app['eccube.repository.csv']);
69
            $csvService->setCsvTypeRepository($app['eccube.repository.master.csv_type']);
70
            $csvService->setOrderRepository($app['eccube.repository.order']);
71
            $csvService->setCustomerRepository($app['eccube.repository.customer']);
72
            $csvService->setProductRepository($app['eccube.repository.product']);
73
74 2
            return $csvService;
75
        });
76
        $app['eccube.service.shopping'] = $app->share(function () use ($app) {
77
            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...
78
        });
79
80
        // Repository
81
        $app['eccube.repository.master.authority'] = $app->share(function () use ($app) {
82
            return $app['orm.em']->getRepository('Eccube\Entity\Master\Authority');
83
        });
84
        $app['eccube.repository.master.tag'] = $app->share(function () use ($app) {
85
            return $app['orm.em']->getRepository('Eccube\Entity\Master\Tag');
86
        });
87
        $app['eccube.repository.master.pref'] = $app->share(function () use ($app) {
88
            return $app['orm.em']->getRepository('Eccube\Entity\Master\Pref');
89
        });
90
        $app['eccube.repository.master.sex'] = $app->share(function () use ($app) {
91
            return $app['orm.em']->getRepository('Eccube\Entity\Master\Sex');
92
        });
93
        $app['eccube.repository.master.disp'] = $app->share(function () use ($app) {
94
            return $app['orm.em']->getRepository('Eccube\Entity\Master\Disp');
95
        });
96
        $app['eccube.repository.master.product_type'] = $app->share(function () use ($app) {
97
            return $app['orm.em']->getRepository('Eccube\Entity\Master\ProductType');
98
        });
99
        $app['eccube.repository.master.page_max'] = $app->share(function () use ($app) {
100
            return $app['orm.em']->getRepository('Eccube\Entity\Master\PageMax');
101
        });
102
        $app['eccube.repository.master.order_status'] = $app->share(function () use ($app) {
103
            return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderStatus');
104
        });
105
        $app['eccube.repository.master.device_type'] = $app->share(function () use ($app) {
106
            return $app['orm.em']->getRepository('Eccube\Entity\Master\DeviceType');
107
        });
108
        $app['eccube.repository.master.csv_type'] = $app->share(function () use ($app) {
109
            return $app['orm.em']->getRepository('Eccube\Entity\Master\CsvType');
110
        });
111
112
        $app['eccube.repository.delivery'] = $app->share(function () use ($app) {
113
            return $app['orm.em']->getRepository('Eccube\Entity\Delivery');
114
        });
115
        $app['eccube.repository.delivery_date'] = $app->share(function () use ($app) {
116
            return $app['orm.em']->getRepository('Eccube\Entity\DeliveryDate');
117
        });
118
        $app['eccube.repository.delivery_fee'] = $app->share(function () use ($app) {
119
            return $app['orm.em']->getRepository('Eccube\Entity\DeliveryFee');
120
        });
121
        $app['eccube.repository.delivery_time'] = $app->share(function () use ($app) {
122
            return $app['orm.em']->getRepository('Eccube\Entity\DeliveryTime');
123
        });
124
        $app['eccube.repository.payment'] = $app->share(function () use ($app) {
125
            return $app['orm.em']->getRepository('Eccube\Entity\Payment');
126
        });
127
        $app['eccube.repository.payment_option'] = $app->share(function () use ($app) {
128
            return $app['orm.em']->getRepository('Eccube\Entity\PaymentOption');
129
        });
130
        $app['eccube.repository.category'] = $app->share(function () use ($app) {
131
            return $app['orm.em']->getRepository('Eccube\Entity\Category');
132
        });
133
        $app['eccube.repository.customer'] = $app->share(function () use ($app) {
134
            return $app['orm.em']->getRepository('Eccube\Entity\Customer');
135
        });
136
        $app['eccube.repository.news'] = $app->share(function () use ($app) {
137
            return $app['orm.em']->getRepository('Eccube\Entity\News');
138
        });
139
        $app['eccube.repository.mail_history'] = $app->share(function () use ($app) {
140
            return $app['orm.em']->getRepository('Eccube\Entity\MailHistory');
141
        });
142
        $app['eccube.repository.member'] = $app->share(function () use ($app) {
143
            $memberRepository = $app['orm.em']->getRepository('Eccube\Entity\Member');
144
            $memberRepository->setEncoderFactorty($app['security.encoder_factory']);
145 246
            return $memberRepository;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
146
        });
147
        $app['eccube.repository.order'] = $app->share(function () use ($app) {
148
            return $app['orm.em']->getRepository('Eccube\Entity\Order');
149
        });
150
        $app['eccube.repository.product'] = $app->share(function () use ($app) {
151
            $productRepository = $app['orm.em']->getRepository('Eccube\Entity\Product');
152 36
            return $productRepository;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
153
        });
154
        $app['eccube.repository.product_image'] = $app->share(function () use ($app) {
155
            return $app['orm.em']->getRepository('Eccube\Entity\ProductImage');
156
        });
157
        $app['eccube.repository.product_class'] = $app->share(function () use ($app) {
158
            return $app['orm.em']->getRepository('Eccube\Entity\ProductClass');
159
        });
160
        $app['eccube.repository.product_stock'] = $app->share(function () use ($app) {
161
            return $app['orm.em']->getRepository('Eccube\Entity\ProductStock');
162
        });
163
        $app['eccube.repository.class_name'] = $app->share(function () use ($app) {
164
            return $app['orm.em']->getRepository('Eccube\Entity\ClassName');
165
        });
166
        $app['eccube.repository.class_category'] = $app->share(function () use ($app) {
167
            return $app['orm.em']->getRepository('Eccube\Entity\ClassCategory');
168
        });
169
        $app['eccube.repository.customer_favorite_product'] = $app->share(function () use ($app) {
170
            return $app['orm.em']->getRepository('Eccube\Entity\CustomerFavoriteProduct');
171
        });
172
        $app['eccube.repository.base_info'] = $app->share(function () use ($app) {
173
            return $app['orm.em']->getRepository('Eccube\Entity\BaseInfo');
174
        });
175
        $app['eccube.repository.tax_rule'] = $app->share(function () use ($app) {
176
            $taxRuleRepository = $app['orm.em']->getRepository('Eccube\Entity\TaxRule');
177
            $taxRuleRepository->setApplication($app);
178
179 119
            return $taxRuleRepository;
180
        });
181
        $app['eccube.repository.page_layout'] = $app->share(function () use ($app) {
182
            $pageLayoutRepository = $app['orm.em']->getRepository('Eccube\Entity\PageLayout');
183
            $pageLayoutRepository->setApplication($app);
184
185 62
            return $pageLayoutRepository;
186
        });
187
        $app['eccube.repository.block'] = $app->share(function () use ($app) {
188
            $blockRepository = $app['orm.em']->getRepository('Eccube\Entity\Block');
189
            $blockRepository->setApplication($app);
190
191 9
            return $blockRepository;
192
        });
193
        $app['eccube.repository.order'] = $app->share(function () use ($app) {
194
            $orderRepository = $app['orm.em']->getRepository('Eccube\Entity\Order');
195
            $orderRepository->setApplication($app);
196
197 74
            return $orderRepository;
198
        });
199
        $app['eccube.repository.customer_address'] = $app->share(function () use ($app) {
200
            return $app['orm.em']->getRepository('Eccube\Entity\CustomerAddress');
201
        });
202
        $app['eccube.repository.shipping'] = $app->share(function () use ($app) {
203
            return $app['orm.em']->getRepository('Eccube\Entity\Shipping');
204
        });
205
        $app['eccube.repository.customer_status'] = $app->share(function () use ($app) {
206
            return $app['orm.em']->getRepository('Eccube\Entity\Master\CustomerStatus');
207
        });
208
        $app['eccube.repository.order_status'] = $app->share(function () use ($app) {
209
            return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderStatus');
210
        });
211
        $app['eccube.repository.mail_template'] = $app->share(function () use ($app) {
212
            return $app['orm.em']->getRepository('Eccube\Entity\MailTemplate');
213
        });
214
        $app['eccube.repository.csv'] = $app->share(function () use ($app) {
215
            return $app['orm.em']->getRepository('Eccube\Entity\Csv');
216
        });
217
        $app['eccube.repository.template'] = $app->share(function () use ($app) {
218
            return $app['orm.em']->getRepository('Eccube\Entity\Template');
219
        });
220
        $app['eccube.repository.authority_role'] = $app->share(function () use ($app) {
221
            return $app['orm.em']->getRepository('Eccube\Entity\AuthorityRole');
222
        });
223
224
        $app['paginator'] = $app->protect(function () {
225
            return new \Knp\Component\Pager\Paginator();
226
        });
227
228
        $app['eccube.repository.help'] = $app->share(function () use ($app) {
229
            return $app['orm.em']->getRepository('Eccube\Entity\Help');
230
        });
231
        $app['eccube.repository.plugin'] = $app->share(function () use ($app) {
232
            return $app['orm.em']->getRepository('Eccube\Entity\Plugin');
233
        });
234
        $app['eccube.repository.plugin_event_handler'] = $app->share(function () use ($app) {
235
            return $app['orm.em']->getRepository('Eccube\Entity\PluginEventHandler');
236
        });
237
        // em
238
        if (isset($app['orm.em'])) {
239
            $app['orm.em'] = $app->share($app->extend('orm.em', function (\Doctrine\ORM\EntityManager $em, \Silex\Application $app) {
240
                // tax_rule
241
                $taxRuleRepository = $em->getRepository('Eccube\Entity\TaxRule');
242
                $taxRuleRepository->setApplication($app);
243
                $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...
244
                $em->getEventManager()->addEventSubscriber(new \Eccube\Doctrine\EventSubscriber\TaxRuleEventSubscriber($taxRuleService));
245
246
                // save
247
                $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...
248
                $em->getEventManager()->addEventSubscriber($saveEventSubscriber);
249
250
                // filters
251
                $config = $em->getConfiguration();
252
                $config->addFilter("soft_delete", '\Eccube\Doctrine\Filter\SoftDeleteFilter');
253
                $config->addFilter("nostock_hidden", '\Eccube\Doctrine\Filter\NoStockHiddenFilter');
254
                $config->addFilter("incomplete_order_status_hidden", '\Eccube\Doctrine\Filter\OrderStatusFilter');
255
                $em->getFilters()->enable('soft_delete');
256
257 676
                return $em;
258
            }));
259
        }
260
261
        // Form\Type
262
        $app['form.type.extensions'] = $app->share($app->extend('form.type.extensions', function ($extensions) use ($app) {
263
            $extensions[] = new \Eccube\Form\Extension\HelpTypeExtension();
264
            $extensions[] = new \Eccube\Form\Extension\FreezeTypeExtension();
265
266 311
            return $extensions;
267
        }));
268 311
        $app['form.types'] = $app->share($app->extend('form.types', function ($types) use ($app) {
269
            $types[] = new \Eccube\Form\Type\NameType($app['config']);
270
            $types[] = new \Eccube\Form\Type\KanaType($app['config']);
271
            $types[] = new \Eccube\Form\Type\TelType($app['config']);
272
            $types[] = new \Eccube\Form\Type\FaxType(); // 削除予定
273
            $types[] = new \Eccube\Form\Type\ZipType($app['config']);
274
            $types[] = new \Eccube\Form\Type\AddressType($app['config']);
275
            $types[] = new \Eccube\Form\Type\RepeatedEmailType();
276
            $types[] = new \Eccube\Form\Type\RepeatedPasswordType($app['config']);
277
            $types[] = new \Eccube\Form\Type\PriceType($app['config']);
278
279
            $types[] = new \Eccube\Form\Type\MasterType();
280
            $types[] = new \Eccube\Form\Type\Master\JobType();
281
            $types[] = new \Eccube\Form\Type\Master\CustomerStatusType();
282
            $types[] = new \Eccube\Form\Type\Master\OrderStatusType();
283
            $types[] = new \Eccube\Form\Type\Master\CalcRuleType();
284
            $types[] = new \Eccube\Form\Type\Master\SexType();
285
            $types[] = new \Eccube\Form\Type\Master\DispType();
286
            $types[] = new \Eccube\Form\Type\Master\PrefType();
287
            $types[] = new \Eccube\Form\Type\Master\ProductTypeType();
288
            $types[] = new \Eccube\Form\Type\Master\ProductListMaxType();
289
            $types[] = new \Eccube\Form\Type\Master\ProductListOrderByType();
290
            $types[] = new \Eccube\Form\Type\Master\PageMaxType();
291
            $types[] = new \Eccube\Form\Type\Master\CsvType();
292
            $types[] = new \Eccube\Form\Type\Master\DeliveryDateType();
293
            $types[] = new \Eccube\Form\Type\Master\PaymentType();
294
            $types[] = new \Eccube\Form\Type\Master\MailTemplateType();
295
            $types[] = new \Eccube\Form\Type\Master\CategoryType();
296
297
            $types[] = new \Eccube\Form\Type\CustomerType($app); // 削除予定
298
299
            if (isset($app['security']) && isset($app['eccube.repository.customer_favorite_product'])) {
300
                $types[] = new \Eccube\Form\Type\AddCartType($app['config'], $app['security'], $app['eccube.repository.customer_favorite_product']);
301
            }
302
            $types[] = new \Eccube\Form\Type\SearchProductType();
303
            $types[] = new \Eccube\Form\Type\OrderSearchType($app);
304
            $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...
305
            $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...
306
            $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...
307
            $types[] = new \Eccube\Form\Type\ShoppingType();
308
309
            // front
310
            $types[] = new \Eccube\Form\Type\Front\EntryType($app['config']);
311
            $types[] = new \Eccube\Form\Type\Front\ContactType($app['config']);
312
            $types[] = new \Eccube\Form\Type\Front\NonMemberType($app['config']);
313
            $types[] = new \Eccube\Form\Type\Front\ShoppingShippingType();
314
            $types[] = new \Eccube\Form\Type\Front\CustomerAddressType($app['config']);
315
            $types[] = new \Eccube\Form\Type\Front\ForgotType();
316
            $types[] = new \Eccube\Form\Type\Front\CustomerLoginType($app['session']);
317
318
            // admin
319
            $types[] = new \Eccube\Form\Type\Admin\LoginType($app['session']);
320
            $types[] = new \Eccube\Form\Type\Admin\ProductType($app);
321
            $types[] = new \Eccube\Form\Type\Admin\ProductClassType($app);
322
            $types[] = new \Eccube\Form\Type\Admin\SearchProductType($app);
323
            $types[] = new \Eccube\Form\Type\Admin\SearchCustomerType($app['config']);
324
            $types[] = new \Eccube\Form\Type\Admin\SearchOrderType($app['config']);
325
            $types[] = new \Eccube\Form\Type\Admin\CustomerType($app['config']);
326
            $types[] = new \Eccube\Form\Type\Admin\ClassNameType($app['config']);
327
            $types[] = new \Eccube\Form\Type\Admin\ClassCategoryType($app['config']);
328
            $types[] = new \Eccube\Form\Type\Admin\CategoryType($app['config']);
329
            $types[] = new \Eccube\Form\Type\Admin\MemberType($app['config']);
330
            $types[] = new \Eccube\Form\Type\Admin\AuthorityRoleType($app['config']);
331
            $types[] = new \Eccube\Form\Type\Admin\PageLayoutType();
332
            $types[] = new \Eccube\Form\Type\Admin\NewsType($app['config']);
333
            $types[] = new \Eccube\Form\Type\Admin\TemplateType($app['config']);
334
            $types[] = new \Eccube\Form\Type\Admin\SecurityType($app);
335
            $types[] = new \Eccube\Form\Type\Admin\CsvImportType($app);
336
            $types[] = new \Eccube\Form\Type\Admin\ShopMasterType($app['config']);
337
            $types[] = new \Eccube\Form\Type\Admin\TradelawType($app['config']);
338
            $types[] = new \Eccube\Form\Type\Admin\OrderType($app);
339
            $types[] = new \Eccube\Form\Type\Admin\OrderDetailType($app);
340
            $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...
341
            $types[] = new \Eccube\Form\Type\Admin\ShipmentItemType($app);
342
            $types[] = new \Eccube\Form\Type\Admin\PaymentRegisterType();
343
            $types[] = new \Eccube\Form\Type\Admin\TaxRuleType();
344
            $types[] = new \Eccube\Form\Type\Admin\MainEditType($app);
345
            $types[] = new \Eccube\Form\Type\Admin\MailType();
346
            $types[] = new \Eccube\Form\Type\Admin\CustomerAgreementType($app);
347
            $types[] = new \Eccube\Form\Type\Admin\BlockType($app);
348
            $types[] = new \Eccube\Form\Type\Admin\DeliveryType();
349
            $types[] = new \Eccube\Form\Type\Admin\DeliveryFeeType();
350
            $types[] = new \Eccube\Form\Type\Admin\DeliveryTimeType($app['config']);
351
            $types[] = new \Eccube\Form\Type\Admin\LogType($app['config']);
352
353
            $types[] = new \Eccube\Form\Type\Admin\MasterdataType($app);
354
            $types[] = new \Eccube\Form\Type\Admin\MasterdataEditType($app);
355
356
            $types[] = new \Eccube\Form\Type\Admin\PluginLocalInstallType();
357
            $types[] = new \Eccube\Form\Type\Admin\PluginManagementType();
358
359 311
            return $types;
360
        }));
361
    }
362
363
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$app" missing
Loading history...
364
     * Bootstraps the application.
365
     *
366
     * This method is called after all services are registered
367
     * and should be used for "dynamic" configuration (whenever
368
     * a service must be requested).
369
     */
370 676
    public function boot(BaseApplication $app)
371
    {
372 676
    }
373
}
374