Completed
Pull Request — master (#1922)
by chihiro
39:05
created

EccubeServiceProvider   C

Complexity

Total Complexity 5

Size/Duplication

Total Lines 365
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 102

Test Coverage

Coverage 97.54%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
dl 0
loc 365
ccs 238
cts 244
cp 0.9754
rs 5
c 2
b 0
f 0
wmc 5
lcom 0
cbo 102

2 Methods

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