Completed
Pull Request — master (#1810)
by Lam
371:27 queued 364:11
created
src/Eccube/Security/Voter/AuthorityVoter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 
37 37
     public function __construct(Application $app)
38 38
     {
39
-        $this->app     = $app;
39
+        $this->app = $app;
40 40
     }
41 41
 
42 42
     public function supportsAttribute($attribute)
Please login to merge, or discard this patch.
src/Eccube/ServiceProvider/EccubeServiceProvider.php 1 patch
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -41,28 +41,28 @@  discard block
 block discarded – undo
41 41
     public function register(BaseApplication $app)
42 42
     {
43 43
         // Service
44
-        $app['eccube.service.system'] = $app->share(function () use ($app) {
44
+        $app['eccube.service.system'] = $app->share(function() use ($app) {
45 45
             return new \Eccube\Service\SystemService($app);
46 46
         });
47
-        $app['view'] = $app->share(function () use ($app) {
47
+        $app['view'] = $app->share(function() use ($app) {
48 48
             return $app['twig'];
49 49
         });
50
-        $app['eccube.service.cart'] = $app->share(function () use ($app) {
50
+        $app['eccube.service.cart'] = $app->share(function() use ($app) {
51 51
             return new \Eccube\Service\CartService($app);
52 52
         });
53
-        $app['eccube.service.order'] = $app->share(function () use ($app) {
53
+        $app['eccube.service.order'] = $app->share(function() use ($app) {
54 54
             return new \Eccube\Service\OrderService($app);
55 55
         });
56
-        $app['eccube.service.tax_rule'] = $app->share(function () use ($app) {
56
+        $app['eccube.service.tax_rule'] = $app->share(function() use ($app) {
57 57
             return new \Eccube\Service\TaxRuleService($app['eccube.repository.tax_rule']);
58 58
         });
59
-        $app['eccube.service.plugin'] = $app->share(function () use ($app) {
59
+        $app['eccube.service.plugin'] = $app->share(function() use ($app) {
60 60
             return new \Eccube\Service\PluginService($app);
61 61
         });
62
-        $app['eccube.service.mail'] = $app->share(function () use ($app) {
62
+        $app['eccube.service.mail'] = $app->share(function() use ($app) {
63 63
             return new \Eccube\Service\MailService($app);
64 64
         });
65
-        $app['eccube.service.csv.export'] = $app->share(function () use ($app) {
65
+        $app['eccube.service.csv.export'] = $app->share(function() use ($app) {
66 66
             $csvService = new \Eccube\Service\CsvExportService();
67 67
             $csvService->setConfig($app['config']);
68 68
             $csvService->setCsvRepository($app['eccube.repository.csv']);
@@ -73,170 +73,170 @@  discard block
 block discarded – undo
73 73
 
74 74
             return $csvService;
75 75
         });
76
-        $app['eccube.service.shopping'] = $app->share(function () use ($app) {
76
+        $app['eccube.service.shopping'] = $app->share(function() use ($app) {
77 77
             return new \Eccube\Service\ShoppingService($app, $app['eccube.service.cart'], $app['eccube.service.order']);
78 78
         });
79 79
 
80 80
         // Repository
81
-        $app['eccube.repository.master.authority'] = $app->share(function () use ($app) {
81
+        $app['eccube.repository.master.authority'] = $app->share(function() use ($app) {
82 82
             return $app['orm.em']->getRepository('Eccube\Entity\Master\Authority');
83 83
         });
84
-        $app['eccube.repository.master.tag'] = $app->share(function () use ($app) {
84
+        $app['eccube.repository.master.tag'] = $app->share(function() use ($app) {
85 85
             return $app['orm.em']->getRepository('Eccube\Entity\Master\Tag');
86 86
         });
87
-        $app['eccube.repository.master.pref'] = $app->share(function () use ($app) {
87
+        $app['eccube.repository.master.pref'] = $app->share(function() use ($app) {
88 88
             return $app['orm.em']->getRepository('Eccube\Entity\Master\Pref');
89 89
         });
90
-        $app['eccube.repository.master.sex'] = $app->share(function () use ($app) {
90
+        $app['eccube.repository.master.sex'] = $app->share(function() use ($app) {
91 91
             return $app['orm.em']->getRepository('Eccube\Entity\Master\Sex');
92 92
         });
93
-        $app['eccube.repository.master.disp'] = $app->share(function () use ($app) {
93
+        $app['eccube.repository.master.disp'] = $app->share(function() use ($app) {
94 94
             return $app['orm.em']->getRepository('Eccube\Entity\Master\Disp');
95 95
         });
96
-        $app['eccube.repository.master.product_type'] = $app->share(function () use ($app) {
96
+        $app['eccube.repository.master.product_type'] = $app->share(function() use ($app) {
97 97
             return $app['orm.em']->getRepository('Eccube\Entity\Master\ProductType');
98 98
         });
99
-        $app['eccube.repository.master.page_max'] = $app->share(function () use ($app) {
99
+        $app['eccube.repository.master.page_max'] = $app->share(function() use ($app) {
100 100
             return $app['orm.em']->getRepository('Eccube\Entity\Master\PageMax');
101 101
         });
102
-        $app['eccube.repository.master.order_status'] = $app->share(function () use ($app) {
102
+        $app['eccube.repository.master.order_status'] = $app->share(function() use ($app) {
103 103
             return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderStatus');
104 104
         });
105
-        $app['eccube.repository.master.device_type'] = $app->share(function () use ($app) {
105
+        $app['eccube.repository.master.device_type'] = $app->share(function() use ($app) {
106 106
             return $app['orm.em']->getRepository('Eccube\Entity\Master\DeviceType');
107 107
         });
108
-        $app['eccube.repository.master.csv_type'] = $app->share(function () use ($app) {
108
+        $app['eccube.repository.master.csv_type'] = $app->share(function() use ($app) {
109 109
             return $app['orm.em']->getRepository('Eccube\Entity\Master\CsvType');
110 110
         });
111 111
 
112
-        $app['eccube.repository.delivery'] = $app->share(function () use ($app) {
112
+        $app['eccube.repository.delivery'] = $app->share(function() use ($app) {
113 113
             return $app['orm.em']->getRepository('Eccube\Entity\Delivery');
114 114
         });
115
-        $app['eccube.repository.delivery_date'] = $app->share(function () use ($app) {
115
+        $app['eccube.repository.delivery_date'] = $app->share(function() use ($app) {
116 116
             return $app['orm.em']->getRepository('Eccube\Entity\DeliveryDate');
117 117
         });
118
-        $app['eccube.repository.delivery_fee'] = $app->share(function () use ($app) {
118
+        $app['eccube.repository.delivery_fee'] = $app->share(function() use ($app) {
119 119
             return $app['orm.em']->getRepository('Eccube\Entity\DeliveryFee');
120 120
         });
121
-        $app['eccube.repository.delivery_time'] = $app->share(function () use ($app) {
121
+        $app['eccube.repository.delivery_time'] = $app->share(function() use ($app) {
122 122
             return $app['orm.em']->getRepository('Eccube\Entity\DeliveryTime');
123 123
         });
124
-        $app['eccube.repository.payment'] = $app->share(function () use ($app) {
124
+        $app['eccube.repository.payment'] = $app->share(function() use ($app) {
125 125
             return $app['orm.em']->getRepository('Eccube\Entity\Payment');
126 126
         });
127
-        $app['eccube.repository.payment_option'] = $app->share(function () use ($app) {
127
+        $app['eccube.repository.payment_option'] = $app->share(function() use ($app) {
128 128
             return $app['orm.em']->getRepository('Eccube\Entity\PaymentOption');
129 129
         });
130
-        $app['eccube.repository.category'] = $app->share(function () use ($app) {
130
+        $app['eccube.repository.category'] = $app->share(function() use ($app) {
131 131
             return $app['orm.em']->getRepository('Eccube\Entity\Category');
132 132
         });
133
-        $app['eccube.repository.customer'] = $app->share(function () use ($app) {
133
+        $app['eccube.repository.customer'] = $app->share(function() use ($app) {
134 134
             return $app['orm.em']->getRepository('Eccube\Entity\Customer');
135 135
         });
136
-        $app['eccube.repository.news'] = $app->share(function () use ($app) {
136
+        $app['eccube.repository.news'] = $app->share(function() use ($app) {
137 137
             return $app['orm.em']->getRepository('Eccube\Entity\News');
138 138
         });
139
-        $app['eccube.repository.mail_history'] = $app->share(function () use ($app) {
139
+        $app['eccube.repository.mail_history'] = $app->share(function() use ($app) {
140 140
             return $app['orm.em']->getRepository('Eccube\Entity\MailHistory');
141 141
         });
142
-        $app['eccube.repository.member'] = $app->share(function () use ($app) {
142
+        $app['eccube.repository.member'] = $app->share(function() use ($app) {
143 143
             $memberRepository = $app['orm.em']->getRepository('Eccube\Entity\Member');
144 144
             $memberRepository->setEncoderFactorty($app['security.encoder_factory']);
145 145
             return $memberRepository;
146 146
         });
147
-        $app['eccube.repository.order'] = $app->share(function () use ($app) {
147
+        $app['eccube.repository.order'] = $app->share(function() use ($app) {
148 148
             return $app['orm.em']->getRepository('Eccube\Entity\Order');
149 149
         });
150
-        $app['eccube.repository.product'] = $app->share(function () use ($app) {
150
+        $app['eccube.repository.product'] = $app->share(function() use ($app) {
151 151
             $productRepository = $app['orm.em']->getRepository('Eccube\Entity\Product');
152 152
             return $productRepository;
153 153
         });
154
-        $app['eccube.repository.product_image'] = $app->share(function () use ($app) {
154
+        $app['eccube.repository.product_image'] = $app->share(function() use ($app) {
155 155
             return $app['orm.em']->getRepository('Eccube\Entity\ProductImage');
156 156
         });
157
-        $app['eccube.repository.product_class'] = $app->share(function () use ($app) {
157
+        $app['eccube.repository.product_class'] = $app->share(function() use ($app) {
158 158
             return $app['orm.em']->getRepository('Eccube\Entity\ProductClass');
159 159
         });
160
-        $app['eccube.repository.product_stock'] = $app->share(function () use ($app) {
160
+        $app['eccube.repository.product_stock'] = $app->share(function() use ($app) {
161 161
             return $app['orm.em']->getRepository('Eccube\Entity\ProductStock');
162 162
         });
163
-        $app['eccube.repository.class_name'] = $app->share(function () use ($app) {
163
+        $app['eccube.repository.class_name'] = $app->share(function() use ($app) {
164 164
             return $app['orm.em']->getRepository('Eccube\Entity\ClassName');
165 165
         });
166
-        $app['eccube.repository.class_category'] = $app->share(function () use ($app) {
166
+        $app['eccube.repository.class_category'] = $app->share(function() use ($app) {
167 167
             return $app['orm.em']->getRepository('Eccube\Entity\ClassCategory');
168 168
         });
169
-        $app['eccube.repository.customer_favorite_product'] = $app->share(function () use ($app) {
169
+        $app['eccube.repository.customer_favorite_product'] = $app->share(function() use ($app) {
170 170
             return $app['orm.em']->getRepository('Eccube\Entity\CustomerFavoriteProduct');
171 171
         });
172
-        $app['eccube.repository.base_info'] = $app->share(function () use ($app) {
172
+        $app['eccube.repository.base_info'] = $app->share(function() use ($app) {
173 173
             return $app['orm.em']->getRepository('Eccube\Entity\BaseInfo');
174 174
         });
175
-        $app['eccube.repository.tax_rule'] = $app->share(function () use ($app) {
175
+        $app['eccube.repository.tax_rule'] = $app->share(function() use ($app) {
176 176
             $taxRuleRepository = $app['orm.em']->getRepository('Eccube\Entity\TaxRule');
177 177
             $taxRuleRepository->setApplication($app);
178 178
 
179 179
             return $taxRuleRepository;
180 180
         });
181
-        $app['eccube.repository.page_layout'] = $app->share(function () use ($app) {
181
+        $app['eccube.repository.page_layout'] = $app->share(function() use ($app) {
182 182
             $pageLayoutRepository = $app['orm.em']->getRepository('Eccube\Entity\PageLayout');
183 183
             $pageLayoutRepository->setApplication($app);
184 184
 
185 185
             return $pageLayoutRepository;
186 186
         });
187
-        $app['eccube.repository.block'] = $app->share(function () use ($app) {
187
+        $app['eccube.repository.block'] = $app->share(function() use ($app) {
188 188
             $blockRepository = $app['orm.em']->getRepository('Eccube\Entity\Block');
189 189
             $blockRepository->setApplication($app);
190 190
 
191 191
             return $blockRepository;
192 192
         });
193
-        $app['eccube.repository.order'] = $app->share(function () use ($app) {
193
+        $app['eccube.repository.order'] = $app->share(function() use ($app) {
194 194
             $orderRepository = $app['orm.em']->getRepository('Eccube\Entity\Order');
195 195
             $orderRepository->setApplication($app);
196 196
 
197 197
             return $orderRepository;
198 198
         });
199
-        $app['eccube.repository.customer_address'] = $app->share(function () use ($app) {
199
+        $app['eccube.repository.customer_address'] = $app->share(function() use ($app) {
200 200
             return $app['orm.em']->getRepository('Eccube\Entity\CustomerAddress');
201 201
         });
202
-        $app['eccube.repository.shipping'] = $app->share(function () use ($app) {
202
+        $app['eccube.repository.shipping'] = $app->share(function() use ($app) {
203 203
             return $app['orm.em']->getRepository('Eccube\Entity\Shipping');
204 204
         });
205
-        $app['eccube.repository.customer_status'] = $app->share(function () use ($app) {
205
+        $app['eccube.repository.customer_status'] = $app->share(function() use ($app) {
206 206
             return $app['orm.em']->getRepository('Eccube\Entity\Master\CustomerStatus');
207 207
         });
208
-        $app['eccube.repository.order_status'] = $app->share(function () use ($app) {
208
+        $app['eccube.repository.order_status'] = $app->share(function() use ($app) {
209 209
             return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderStatus');
210 210
         });
211
-        $app['eccube.repository.mail_template'] = $app->share(function () use ($app) {
211
+        $app['eccube.repository.mail_template'] = $app->share(function() use ($app) {
212 212
             return $app['orm.em']->getRepository('Eccube\Entity\MailTemplate');
213 213
         });
214
-        $app['eccube.repository.csv'] = $app->share(function () use ($app) {
214
+        $app['eccube.repository.csv'] = $app->share(function() use ($app) {
215 215
             return $app['orm.em']->getRepository('Eccube\Entity\Csv');
216 216
         });
217
-        $app['eccube.repository.template'] = $app->share(function () use ($app) {
217
+        $app['eccube.repository.template'] = $app->share(function() use ($app) {
218 218
             return $app['orm.em']->getRepository('Eccube\Entity\Template');
219 219
         });
220
-        $app['eccube.repository.authority_role'] = $app->share(function () use ($app) {
220
+        $app['eccube.repository.authority_role'] = $app->share(function() use ($app) {
221 221
             return $app['orm.em']->getRepository('Eccube\Entity\AuthorityRole');
222 222
         });
223 223
 
224
-        $app['paginator'] = $app->protect(function () {
224
+        $app['paginator'] = $app->protect(function() {
225 225
             return new \Knp\Component\Pager\Paginator();
226 226
         });
227 227
 
228
-        $app['eccube.repository.help'] = $app->share(function () use ($app) {
228
+        $app['eccube.repository.help'] = $app->share(function() use ($app) {
229 229
             return $app['orm.em']->getRepository('Eccube\Entity\Help');
230 230
         });
231
-        $app['eccube.repository.plugin'] = $app->share(function () use ($app) {
231
+        $app['eccube.repository.plugin'] = $app->share(function() use ($app) {
232 232
             return $app['orm.em']->getRepository('Eccube\Entity\Plugin');
233 233
         });
234
-        $app['eccube.repository.plugin_event_handler'] = $app->share(function () use ($app) {
234
+        $app['eccube.repository.plugin_event_handler'] = $app->share(function() use ($app) {
235 235
             return $app['orm.em']->getRepository('Eccube\Entity\PluginEventHandler');
236 236
         });
237 237
         // em
238 238
         if (isset($app['orm.em'])) {
239
-            $app['orm.em'] = $app->share($app->extend('orm.em', function (\Doctrine\ORM\EntityManager $em, \Silex\Application $app) {
239
+            $app['orm.em'] = $app->share($app->extend('orm.em', function(\Doctrine\ORM\EntityManager $em, \Silex\Application $app) {
240 240
                 // tax_rule
241 241
                 $taxRuleRepository = $em->getRepository('Eccube\Entity\TaxRule');
242 242
                 $taxRuleRepository->setApplication($app);
@@ -259,13 +259,13 @@  discard block
 block discarded – undo
259 259
         }
260 260
 
261 261
         // Form\Type
262
-        $app['form.type.extensions'] = $app->share($app->extend('form.type.extensions', function ($extensions) use ($app) {
262
+        $app['form.type.extensions'] = $app->share($app->extend('form.type.extensions', function($extensions) use ($app) {
263 263
             $extensions[] = new \Eccube\Form\Extension\HelpTypeExtension();
264 264
             $extensions[] = new \Eccube\Form\Extension\FreezeTypeExtension();
265 265
 
266 266
             return $extensions;
267 267
         }));
268
-        $app['form.types'] = $app->share($app->extend('form.types', function ($types) use ($app) {
268
+        $app['form.types'] = $app->share($app->extend('form.types', function($types) use ($app) {
269 269
             $types[] = new \Eccube\Form\Type\NameType($app['config']);
270 270
             $types[] = new \Eccube\Form\Type\KanaType($app['config']);
271 271
             $types[] = new \Eccube\Form\Type\TelType($app['config']);
Please login to merge, or discard this patch.
src/Eccube/Controller/ForgotController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
                 // リセットキーの発行・有効期限の設定
48 48
                 $Customer
49 49
                     ->setResetKey($app['eccube.repository.customer']->getUniqueResetKey($app))
50
-                    ->setResetExpire(new \DateTime('+' . $app['config']['customer_reset_expire'] .' min'));
50
+                    ->setResetExpire(new \DateTime('+'.$app['config']['customer_reset_expire'].' min'));
51 51
 
52 52
                 // リセットキーを更新
53 53
                 $app['orm.em']->persist($Customer);
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
                 // ログ出力
63 63
                 $app['monolog']->addInfo(
64
-                    'send reset password mail to:'  . "{$Customer->getId()} {$Customer->getEmail()} {$request->getClientIp()}"
64
+                    'send reset password mail to:'."{$Customer->getId()} {$Customer->getEmail()} {$request->getClientIp()}"
65 65
                 );
66 66
             }
67 67
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 
116 116
             // ログ出力
117 117
             $app['monolog']->addInfo(
118
-                'reset password complete:' . "{$Customer->getId()} {$Customer->getEmail()} {$request->getClientIp()}"
118
+                'reset password complete:'."{$Customer->getId()} {$Customer->getEmail()} {$request->getClientIp()}"
119 119
             );
120 120
         } else {
121 121
             throw new HttpException\AccessDeniedHttpException('不正なアクセスです。');
Please login to merge, or discard this patch.
src/Eccube/Controller/Mypage/WithdrawController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
                     // 会員削除
61 61
                     $email = $Customer->getEmail();
62 62
                     // メールアドレスにダミーをセット
63
-                    $Customer->setEmail(Str::random(60) . '@dummy.dummy');
63
+                    $Customer->setEmail(Str::random(60).'@dummy.dummy');
64 64
                     $Customer->setDelFlg(Constant::ENABLED);
65 65
 
66 66
                     $app['orm.em']->flush();
Please login to merge, or discard this patch.
src/Eccube/Form/Type/Install/Step4Type.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
                     new Assert\Callback(array($this, 'validate')),
97 97
                 ),
98 98
             ))
99
-            ->addEventListener(FormEvents::POST_SUBMIT, function ($event) {
99
+            ->addEventListener(FormEvents::POST_SUBMIT, function($event) {
100 100
                 $form = $event->getForm();
101 101
                 $data = $form->getData();
102 102
                 try {
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                     $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config);
122 122
                     $conn->connect();
123 123
                 } catch (\Exception $e) {
124
-                    $form['database']->addError(new FormError('データベースに接続できませんでした。' . $e->getMessage()));
124
+                    $form['database']->addError(new FormError('データベースに接続できませんでした。'.$e->getMessage()));
125 125
                 }
126 126
             });
127 127
     }
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     public function validate($data, ExecutionContext $context, $param = null)
138 138
     {
139 139
         $parameters = $this->app['request']->get('install_step4');
140
-        if ($parameters['database'] != 'pdo_sqlite'){
140
+        if ($parameters['database'] != 'pdo_sqlite') {
141 141
             $context->validateValue($data, array(
142 142
                 new Assert\NotBlank()
143 143
             ));
Please login to merge, or discard this patch.
src/Eccube/Application.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -725,7 +725,7 @@
 block discarded – undo
725 725
      * 成功 : trueを返却
726 726
      * 失敗 : \Doctrine\DBAL\DBALExceptionエラーが発生( 接続に失敗した場合 )、エラー画面を表示しdie()
727 727
      * 備考 : app['debug']がtrueの際は処理を行わない
728
-     * @return boolean true
728
+     * @return null|boolean true
729 729
      *
730 730
      */
731 731
     protected function checkDatabaseConnection()
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         $this->register(new \Eccube\ServiceProvider\ValidatorServiceProvider());
134 134
 
135 135
         $app = $this;
136
-        $this->error(function (\Exception $e, $code) use ($app) {
136
+        $this->error(function(\Exception $e, $code) use ($app) {
137 137
             if ($app['debug']) {
138 138
                 return;
139 139
             }
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
         $this->register(new \Silex\Provider\TranslationServiceProvider(), array(
198 198
             'locale' => $this['config']['locale'],
199 199
         ));
200
-        $this['translator'] = $this->share($this->extend('translator', function ($translator, \Silex\Application $app) {
200
+        $this['translator'] = $this->share($this->extend('translator', function($translator, \Silex\Application $app) {
201 201
             $translator->addLoader('yaml', new \Symfony\Component\Translation\Loader\YamlFileLoader());
202 202
 
203 203
             $r = new \ReflectionClass('Symfony\Component\Validator\Validator');
@@ -241,16 +241,16 @@  discard block
 block discarded – undo
241 241
         $this->register(new \Silex\Provider\TwigServiceProvider(), array(
242 242
             'twig.form.templates' => array('Form/form_layout.twig'),
243 243
         ));
244
-        $this['twig'] = $this->share($this->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) {
244
+        $this['twig'] = $this->share($this->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) {
245 245
             $twig->addExtension(new \Eccube\Twig\Extension\EccubeExtension($app));
246 246
             $twig->addExtension(new \Twig_Extension_StringLoader());
247 247
 
248 248
             return $twig;
249 249
         }));
250 250
 
251
-        $this->before(function (Request $request, \Silex\Application $app) {
251
+        $this->before(function(Request $request, \Silex\Application $app) {
252 252
             // フロント or 管理画面ごとにtwigの探索パスを切り替える.
253
-            $app['twig'] = $app->share($app->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) {
253
+            $app['twig'] = $app->share($app->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) {
254 254
                 $paths = array();
255 255
 
256 256
                 // 互換性がないのでprofiler とproduction 時のcacheを分離する
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 
303 303
         // twigのグローバル変数を定義.
304 304
         $app = $this;
305
-        $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) use ($app) {
305
+        $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) use ($app) {
306 306
             // ショップ基本情報
307 307
             $BaseInfo = $app['eccube.repository.base_info']->get();
308 308
             $app['twig']->addGlobal('BaseInfo', $BaseInfo);
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
         // メール送信時の文字エンコード指定(デフォルトはUTF-8)
363 363
         if (isset($this['config']['mail']['charset_iso_2022_jp']) && is_bool($this['config']['mail']['charset_iso_2022_jp'])) {
364 364
             if ($this['config']['mail']['charset_iso_2022_jp'] === true) {
365
-                \Swift::init(function () {
365
+                \Swift::init(function() {
366 366
                     \Swift_DependencyContainer::getInstance()
367 367
                         ->register('mime.qpheaderencoder')
368 368
                         ->asAliasOf('mime.base64headerencoder');
@@ -529,19 +529,19 @@  discard block
 block discarded – undo
529 529
             array('^/mypage', 'ROLE_USER'),
530 530
         );
531 531
 
532
-        $this['eccube.password_encoder'] = $this->share(function ($app) {
532
+        $this['eccube.password_encoder'] = $this->share(function($app) {
533 533
             return new \Eccube\Security\Core\Encoder\PasswordEncoder($app['config']);
534 534
         });
535
-        $this['security.encoder_factory'] = $this->share(function ($app) {
535
+        $this['security.encoder_factory'] = $this->share(function($app) {
536 536
             return new \Symfony\Component\Security\Core\Encoder\EncoderFactory(array(
537 537
                 'Eccube\Entity\Customer' => $app['eccube.password_encoder'],
538 538
                 'Eccube\Entity\Member' => $app['eccube.password_encoder'],
539 539
             ));
540 540
         });
541
-        $this['eccube.event_listner.security'] = $this->share(function ($app) {
541
+        $this['eccube.event_listner.security'] = $this->share(function($app) {
542 542
             return new \Eccube\EventListener\SecurityEventListener($app['orm.em']);
543 543
         });
544
-        $this['user'] = function ($app) {
544
+        $this['user'] = function($app) {
545 545
             $token = $app['security']->getToken();
546 546
 
547 547
             return ($token !== null) ? $token->getUser() : null;
@@ -552,17 +552,17 @@  discard block
 block discarded – undo
552 552
 
553 553
         // Voterの設定
554 554
         $app = $this;
555
-        $this['authority_voter'] = $this->share(function ($app) {
555
+        $this['authority_voter'] = $this->share(function($app) {
556 556
             return new \Eccube\Security\Voter\AuthorityVoter($app);
557 557
         });
558 558
 
559
-        $app['security.voters'] = $app->extend('security.voters', function ($voters) use ($app) {
559
+        $app['security.voters'] = $app->extend('security.voters', function($voters) use ($app) {
560 560
             $voters[] = $app['authority_voter'];
561 561
 
562 562
             return $voters;
563 563
         });
564 564
 
565
-        $this['security.access_manager'] = $this->share(function ($app) {
565
+        $this['security.access_manager'] = $this->share(function($app) {
566 566
             return new \Symfony\Component\Security\Core\Authorization\AccessDecisionManager($app['security.voters'], 'unanimous');
567 567
         });
568 568
 
@@ -586,14 +586,14 @@  discard block
 block discarded – undo
586 586
     public function initPluginEventDispatcher()
587 587
     {
588 588
         // EventDispatcher
589
-        $this['eccube.event.dispatcher'] = $this->share(function () {
589
+        $this['eccube.event.dispatcher'] = $this->share(function() {
590 590
             return new EventDispatcher();
591 591
         });
592 592
 
593 593
         $app = $this;
594 594
 
595 595
         // hook point
596
-        $this->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($app) {
596
+        $this->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($app) {
597 597
             if (!$event->isMasterRequest()) {
598 598
                 return;
599 599
             }
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
             $app['eccube.event.dispatcher']->dispatch($hookpoint, $event);
602 602
         }, self::EARLY_EVENT);
603 603
 
604
-        $this->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($app) {
604
+        $this->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($app) {
605 605
             if (!$event->isMasterRequest()) {
606 606
                 return;
607 607
             }
@@ -610,7 +610,7 @@  discard block
 block discarded – undo
610 610
             $app['eccube.event.dispatcher']->dispatch($hookpoint, $event);
611 611
         });
612 612
 
613
-        $this->on(KernelEvents::RESPONSE, function (FilterResponseEvent $event) use ($app) {
613
+        $this->on(KernelEvents::RESPONSE, function(FilterResponseEvent $event) use ($app) {
614 614
             if (!$event->isMasterRequest()) {
615 615
                 return;
616 616
             }
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
             $app['eccube.event.dispatcher']->dispatch($hookpoint, $event);
620 620
         });
621 621
 
622
-        $this->on(KernelEvents::RESPONSE, function (FilterResponseEvent $event) use ($app) {
622
+        $this->on(KernelEvents::RESPONSE, function(FilterResponseEvent $event) use ($app) {
623 623
             if (!$event->isMasterRequest()) {
624 624
                 return;
625 625
             }
@@ -627,19 +627,19 @@  discard block
 block discarded – undo
627 627
             $app['eccube.event.dispatcher']->dispatch($hookpoint, $event);
628 628
         }, self::LATE_EVENT);
629 629
 
630
-        $this->on(KernelEvents::TERMINATE, function (PostResponseEvent $event) use ($app) {
630
+        $this->on(KernelEvents::TERMINATE, function(PostResponseEvent $event) use ($app) {
631 631
             $route = $event->getRequest()->attributes->get('_route');
632 632
             $hookpoint = "eccube.event.controller.$route.finish";
633 633
             $app['eccube.event.dispatcher']->dispatch($hookpoint, $event);
634 634
         });
635 635
 
636
-        $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) {
636
+        $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) {
637 637
             $route = $event->getRequest()->attributes->get('_route');
638 638
             $app['eccube.event.dispatcher']->dispatch('eccube.event.render.'.$route.'.before', $event);
639 639
         });
640 640
 
641 641
         // Request Event
642
-        $this->on(\Symfony\Component\HttpKernel\KernelEvents::REQUEST, function (\Symfony\Component\HttpKernel\Event\GetResponseEvent $event) use ($app) {
642
+        $this->on(\Symfony\Component\HttpKernel\KernelEvents::REQUEST, function(\Symfony\Component\HttpKernel\Event\GetResponseEvent $event) use ($app) {
643 643
 
644 644
             if (\Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
645 645
                 return;
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
         }, 30); // Routing(32)が解決しし, 認証判定(8)が実行される前のタイミング.
671 671
 
672 672
         // Controller Event
673
-        $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) use ($app) {
673
+        $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) use ($app) {
674 674
 
675 675
             if (\Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
676 676
                 return;
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
         });
702 702
 
703 703
         // Response Event
704
-        $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) {
704
+        $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) {
705 705
 
706 706
             if (\Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
707 707
                 return;
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
         });
732 732
 
733 733
         // Exception Event
734
-        $this->on(\Symfony\Component\HttpKernel\KernelEvents::EXCEPTION, function (\Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event) use ($app) {
734
+        $this->on(\Symfony\Component\HttpKernel\KernelEvents::EXCEPTION, function(\Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event) use ($app) {
735 735
 
736 736
             if (\Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
737 737
                 return;
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
         });
762 762
 
763 763
         // Terminate Event
764
-        $this->on(\Symfony\Component\HttpKernel\KernelEvents::TERMINATE, function (\Symfony\Component\HttpKernel\Event\PostResponseEvent $event) use ($app) {
764
+        $this->on(\Symfony\Component\HttpKernel\KernelEvents::TERMINATE, function(\Symfony\Component\HttpKernel\Event\PostResponseEvent $event) use ($app) {
765 765
 
766 766
             $route = $event->getRequest()->attributes->get('_route');
767 767
 
@@ -840,7 +840,7 @@  discard block
 block discarded – undo
840 840
 
841 841
             // const
842 842
             if (isset($config['const'])) {
843
-                $this['config'] = $this->share($this->extend('config', function ($eccubeConfig) use ($config) {
843
+                $this['config'] = $this->share($this->extend('config', function($eccubeConfig) use ($config) {
844 844
                     $eccubeConfig[$config['code']] = array(
845 845
                         'const' => $config['const'],
846 846
                     );
@@ -982,7 +982,7 @@  discard block
 block discarded – undo
982 982
         $app = $this;
983 983
 
984 984
         // Response Event(http cache対応、event実行は一番遅く設定)
985
-        $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) {
985
+        $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) {
986 986
 
987 987
             if ($app['config']['http_cache']['enabled']) {
988 988
                 // httpキャッシュが有効の場合
Please login to merge, or discard this patch.
src/Eccube/Controller/Admin/Product/ProductController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
             foreach ($images as $img) {
178 178
                 foreach ($img as $image) {
179 179
                     $extension = $image->getClientOriginalExtension();
180
-                    $filename = date('mdHis') . uniqid('_') . '.' . $extension;
180
+                    $filename = date('mdHis').uniqid('_').'.'.$extension;
181 181
                     $image->move($app['config']['image_temp_realdir'], $filename);
182 182
                     $files[] = $filename;
183 183
                 }
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
         $app['eccube.event.dispatcher']->dispatch(EccubeEvents::ADMIN_PRODUCT_EDIT_INITIALIZE, $event);
240 240
 
241 241
         if (!$has_class) {
242
-            $ProductClass->setStockUnlimited((boolean)$ProductClass->getStockUnlimited());
242
+            $ProductClass->setStockUnlimited((boolean) $ProductClass->getStockUnlimited());
243 243
             $form['class']->setData($ProductClass);
244 244
         }
245 245
 
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
                     $app['orm.em']->persist($ProductImage);
338 338
 
339 339
                     // 移動
340
-                    $file = new File($app['config']['image_temp_realdir'] . '/' . $add_image);
340
+                    $file = new File($app['config']['image_temp_realdir'].'/'.$add_image);
341 341
                     $file->move($app['config']['image_save_realdir']);
342 342
                 }
343 343
 
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 
358 358
                     // 削除
359 359
                     $fs = new Filesystem();
360
-                    $fs->remove($app['config']['image_save_realdir'] . '/' . $delete_image);
360
+                    $fs->remove($app['config']['image_save_realdir'].'/'.$delete_image);
361 361
                 }
362 362
                 $app['orm.em']->persist($Product);
363 363
                 $app['orm.em']->flush();
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
                 foreach ($deleteImages as $deleteImage) {
464 464
                     try {
465 465
                         $fs = new Filesystem();
466
-                        $fs->remove($app['config']['image_save_realdir'] . '/' . $deleteImage);
466
+                        $fs->remove($app['config']['image_save_realdir'].'/'.$deleteImage);
467 467
                     } catch (\Exception $e) {
468 468
                         // エラーが発生しても無視する
469 469
                     }
@@ -527,10 +527,10 @@  discard block
 block discarded – undo
527 527
 
528 528
                     // 画像ファイルを新規作成
529 529
                     $extension = pathinfo($Image->getFileName(), PATHINFO_EXTENSION);
530
-                    $filename = date('mdHis') . uniqid('_') . '.' . $extension;
530
+                    $filename = date('mdHis').uniqid('_').'.'.$extension;
531 531
                     try {
532 532
                         $fs = new Filesystem();
533
-                        $fs->copy($app['config']['image_save_realdir'] . '/' . $Image->getFileName(), $app['config']['image_save_realdir'] . '/' . $filename);
533
+                        $fs->copy($app['config']['image_save_realdir'].'/'.$Image->getFileName(), $app['config']['image_save_realdir'].'/'.$filename);
534 534
                     } catch (\Exception $e) {
535 535
                         // エラーが発生しても無視する
536 536
                     }
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
         $em->getConfiguration()->setSQLLogger(null);
586 586
 
587 587
         $response = new StreamedResponse();
588
-        $response->setCallback(function () use ($app, $request) {
588
+        $response->setCallback(function() use ($app, $request) {
589 589
 
590 590
             // CSV種別を元に初期化.
591 591
             $app['eccube.service.csv.export']->initCsvType(CsvType::CSV_TYPE_PRODUCT);
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
 
610 610
             // データ行の出力.
611 611
             $app['eccube.service.csv.export']->setExportQueryBuilder($qb);
612
-            $app['eccube.service.csv.export']->exportData(function ($entity, $csvService) {
612
+            $app['eccube.service.csv.export']->exportData(function($entity, $csvService) {
613 613
 
614 614
                 $Csvs = $csvService->getCsvs();
615 615
 
@@ -641,9 +641,9 @@  discard block
 block discarded – undo
641 641
         });
642 642
 
643 643
         $now = new \DateTime();
644
-        $filename = 'product_' . $now->format('YmdHis') . '.csv';
644
+        $filename = 'product_'.$now->format('YmdHis').'.csv';
645 645
         $response->headers->set('Content-Type', 'application/octet-stream');
646
-        $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename);
646
+        $response->headers->set('Content-Disposition', 'attachment; filename='.$filename);
647 647
         $response->send();
648 648
 
649 649
         return $response;
Please login to merge, or discard this patch.
src/Eccube/Controller/ProductController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
106 106
             ));
107 107
             $addCartForm = $builder->getForm();
108 108
 
109
-            if ($request->getMethod() === 'POST' && (string)$Product->getId() === $request->get('product_id')) {
109
+            if ($request->getMethod() === 'POST' && (string) $Product->getId() === $request->get('product_id')) {
110 110
                 $addCartForm->handleRequest($request);
111 111
 
112 112
                 if ($addCartForm->isValid()) {
Please login to merge, or discard this patch.
src/Eccube/Controller/Admin/Product/ProductClassController.php 3 patches
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -510,6 +510,8 @@  discard block
 block discarded – undo
510 510
     /**
511 511
      * 登録、更新時のエラー画面表示
512 512
      *
513
+     * @param Application $app
514
+     * @param boolean $not_product_class
513 515
      */
514 516
     protected function render($app, $Product, $ProductClass, $not_product_class, $classForm, $error = null)
515 517
     {
@@ -559,6 +561,7 @@  discard block
 block discarded – undo
559 561
 
560 562
     /**
561 563
      * 規格1と規格2を組み合わせた商品規格を作成
564
+     * @param Application $app
562 565
      */
563 566
     private function createProductClasses($app, Product $Product, ClassName $ClassName1 = null, ClassName $ClassName2 = null)
564 567
     {
@@ -646,6 +649,7 @@  discard block
 block discarded – undo
646 649
      *
647 650
      * @param $productClassDest コピー先となる商品規格
648 651
      * @param $productClassOrig コピー元となる商品規格
652
+     * @param Application $app
649 653
      */
650 654
     private function setDefualtProductClass($app, $productClassDest, $productClassOrig) {
651 655
         $productClassDest->setDeliveryDate($productClassOrig->getDeliveryDate());
@@ -687,6 +691,7 @@  discard block
 block discarded – undo
687 691
      * 商品規格を登録
688 692
      *
689 693
      * @param $ProductClasses 登録される商品規格
694
+     * @param Application $app
690 695
      */
691 696
     private function insertProductClass($app, $Product, $ProductClasses) {
692 697
 
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@
 block discarded – undo
138 138
                                 'allow_add' => true,
139 139
                                 'allow_delete' => true,
140 140
                                 'data' => $ProductClasses,
141
-                             ));
141
+                                ));
142 142
 
143 143
                         $event = new EventArgs(
144 144
                             array(
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
106 106
                     $class2Valied = $this->isValiedCategory($ClassName2);
107 107
 
108 108
                     // 規格が選択されていないか、選択された状態で分類が保有されていれば、画面表示
109
-                    if($class1Valied && $class2Valied){
109
+                    if ($class1Valied && $class2Valied) {
110 110
                         $hasClassCategoryFlg = true;
111 111
                     }
112 112
 
Please login to merge, or discard this patch.