Failed Conditions
Pull Request — experimental/3.1 (#2512)
by chihiro
12:14
created
src/Eccube/Controller/Admin/Order/OrderController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
         log_info('受注削除開始', array($Order->getId()));
304 304
 
305 305
         // 出荷に紐付いている明細がある場合は削除できない.
306
-        $hasShipping = $Order->getItems()->exists(function ($k, $v) {
306
+        $hasShipping = $Order->getItems()->exists(function($k, $v) {
307 307
             return false === is_null($v->getShipping());
308 308
         });
309 309
         if ($hasShipping) {
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
         $em->getConfiguration()->setSQLLogger(null);
362 362
 
363 363
         $response = new StreamedResponse();
364
-        $response->setCallback(function () use ($app, $request) {
364
+        $response->setCallback(function() use ($app, $request) {
365 365
 
366 366
             // CSV種別を元に初期化.
367 367
             $this->csvExportService->initCsvType(CsvType::CSV_TYPE_ORDER);
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 
376 376
             // データ行の出力.
377 377
             $this->csvExportService->setExportQueryBuilder($qb);
378
-            $this->csvExportService->exportData(function ($entity, $csvService) use ($app, $request) {
378
+            $this->csvExportService->exportData(function($entity, $csvService) use ($app, $request) {
379 379
 
380 380
                 $Csvs = $csvService->getCsvs();
381 381
 
@@ -416,9 +416,9 @@  discard block
 block discarded – undo
416 416
         });
417 417
 
418 418
         $now = new \DateTime();
419
-        $filename = 'order_' . $now->format('YmdHis') . '.csv';
419
+        $filename = 'order_'.$now->format('YmdHis').'.csv';
420 420
         $response->headers->set('Content-Type', 'application/octet-stream');
421
-        $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename);
421
+        $response->headers->set('Content-Disposition', 'attachment; filename='.$filename);
422 422
         $response->send();
423 423
 
424 424
         log_info('受注CSV出力ファイル名', array($filename));
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
         $em->getConfiguration()->setSQLLogger(null);
446 446
 
447 447
         $response = new StreamedResponse();
448
-        $response->setCallback(function () use ($app, $request) {
448
+        $response->setCallback(function() use ($app, $request) {
449 449
 
450 450
             // CSV種別を元に初期化.
451 451
             $this->csvExportService->initCsvType(CsvType::CSV_TYPE_SHIPPING);
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 
460 460
             // データ行の出力.
461 461
             $this->csvExportService->setExportQueryBuilder($qb);
462
-            $this->csvExportService->exportData(function ($entity, $csvService) use ($app, $request) {
462
+            $this->csvExportService->exportData(function($entity, $csvService) use ($app, $request) {
463 463
 
464 464
                 $Csvs = $csvService->getCsvs();
465 465
 
@@ -509,9 +509,9 @@  discard block
 block discarded – undo
509 509
         });
510 510
 
511 511
         $now = new \DateTime();
512
-        $filename = 'shipping_' . $now->format('YmdHis') . '.csv';
512
+        $filename = 'shipping_'.$now->format('YmdHis').'.csv';
513 513
         $response->headers->set('Content-Type', 'application/octet-stream');
514
-        $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename);
514
+        $response->headers->set('Content-Disposition', 'attachment; filename='.$filename);
515 515
         $response->send();
516 516
 
517 517
         log_info('配送CSV出力ファイル名', array($filename));
Please login to merge, or discard this patch.
src/Eccube/Controller/Admin/Setting/Shop/PaymentController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -242,7 +242,7 @@
 block discarded – undo
242 242
             $this->eventDispatcher->dispatch(EccubeEvents::ADMIN_SETTING_SHOP_PAYMENT_DELETE_COMPLETE, $event);
243 243
 
244 244
             $app->addSuccess('admin.delete.complete', 'admin');
245
-        } catch(ForeignKeyConstraintViolationException $e) {
245
+        } catch (ForeignKeyConstraintViolationException $e) {
246 246
             $this->entityManager->rollback();
247 247
             $app->addError('admin.payment.delete.error', 'admin');
248 248
         }
Please login to merge, or discard this patch.
src/Eccube/Repository/PluginEventHandlerRepository.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -73,17 +73,17 @@  discard block
 block discarded – undo
73 73
 
74 74
         $qb = $this->createQueryBuilder('e');
75 75
         $qb->andWhere("e.priority >= $range_end ")
76
-           ->andWhere("e.priority <= $range_start ")
77
-           ->andWhere('e.event = :event')
78
-           ->setParameter('event',$event)
79
-           ->setMaxResults(1)
80
-           ->orderBy('e.priority','ASC');
76
+            ->andWhere("e.priority <= $range_start ")
77
+            ->andWhere('e.event = :event')
78
+            ->setParameter('event',$event)
79
+            ->setMaxResults(1)
80
+            ->orderBy('e.priority','ASC');
81 81
 
82 82
         $result=$qb->getQuery()->getResult();
83 83
         if(count($result)){
84
-             return $result[0]->getPriority() -1;
84
+                return $result[0]->getPriority() -1;
85 85
         }else{
86
-             return $range_start;
86
+                return $range_start;
87 87
         }
88 88
 
89 89
     }
@@ -96,13 +96,13 @@  discard block
 block discarded – undo
96 96
         $qb = $this->createQueryBuilder('e');
97 97
 
98 98
         $qb->andWhere("e.priority >= $range_end ")
99
-           ->andWhere("e.priority <= $range_start ")
100
-           ->andWhere('e.priority '.($up ?  '>' : '<' ).' :pri')
101
-           ->andWhere('e.event = :event')
102
-           ->setParameter('event',$pluginEventHandler->getEvent())
103
-           ->setParameter('pri',  $pluginEventHandler->getPriority()  )
104
-           ->setMaxResults(1)
105
-           ->orderBy('e.priority', ($up ? 'ASC':'DESC' )  );
99
+            ->andWhere("e.priority <= $range_start ")
100
+            ->andWhere('e.priority '.($up ?  '>' : '<' ).' :pri')
101
+            ->andWhere('e.event = :event')
102
+            ->setParameter('event',$pluginEventHandler->getEvent())
103
+            ->setParameter('pri',  $pluginEventHandler->getPriority()  )
104
+            ->setMaxResults(1)
105
+            ->orderBy('e.priority', ($up ? 'ASC':'DESC' )  );
106 106
 
107 107
         $result=$qb->getQuery()->getResult();
108 108
 
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
     {
43 43
         $qb = $this->createQueryBuilder('e')
44 44
             ->innerJoin('e.Plugin', 'p')
45
-            ->Orderby('e.event','ASC') 
46
-            ->addOrderby('e.priority','DESC');
45
+            ->Orderby('e.event', 'ASC') 
46
+            ->addOrderby('e.priority', 'DESC');
47 47
             ;
48 48
 
49 49
         return $qb->getQuery()->getResult();
@@ -52,65 +52,65 @@  discard block
 block discarded – undo
52 52
     public function getPriorityRange($type)
53 53
     {
54 54
 
55
-        if(PluginEventHandler::EVENT_HANDLER_TYPE_FIRST==$type){
56
-            $range_start=PluginEventHandler::EVENT_PRIORITY_FIRST_START;
57
-            $range_end=PluginEventHandler::EVENT_PRIORITY_FIRST_END;
58
-        }elseif(PluginEventHandler::EVENT_HANDLER_TYPE_LAST==$type){
59
-            $range_start=PluginEventHandler::EVENT_PRIORITY_LAST_START;
60
-            $range_end=PluginEventHandler::EVENT_PRIORITY_LAST_END;
61
-        }else{
62
-            $range_start=PluginEventHandler::EVENT_PRIORITY_NORMAL_START;
63
-            $range_end=PluginEventHandler::EVENT_PRIORITY_NORMAL_END;
55
+        if (PluginEventHandler::EVENT_HANDLER_TYPE_FIRST == $type) {
56
+            $range_start = PluginEventHandler::EVENT_PRIORITY_FIRST_START;
57
+            $range_end = PluginEventHandler::EVENT_PRIORITY_FIRST_END;
58
+        }elseif (PluginEventHandler::EVENT_HANDLER_TYPE_LAST == $type) {
59
+            $range_start = PluginEventHandler::EVENT_PRIORITY_LAST_START;
60
+            $range_end = PluginEventHandler::EVENT_PRIORITY_LAST_END;
61
+        } else {
62
+            $range_start = PluginEventHandler::EVENT_PRIORITY_NORMAL_START;
63
+            $range_end = PluginEventHandler::EVENT_PRIORITY_NORMAL_END;
64 64
         }
65
-        return array($range_start,$range_end);
65
+        return array($range_start, $range_end);
66 66
 
67 67
     }
68 68
 
69
-    public function calcNewPriority($event , $type)
69
+    public function calcNewPriority($event, $type)
70 70
     {
71 71
 
72
-        list($range_start,$range_end) = $this->getPriorityRange($type);
72
+        list($range_start, $range_end) = $this->getPriorityRange($type);
73 73
 
74 74
         $qb = $this->createQueryBuilder('e');
75 75
         $qb->andWhere("e.priority >= $range_end ")
76 76
            ->andWhere("e.priority <= $range_start ")
77 77
            ->andWhere('e.event = :event')
78
-           ->setParameter('event',$event)
78
+           ->setParameter('event', $event)
79 79
            ->setMaxResults(1)
80
-           ->orderBy('e.priority','ASC');
80
+           ->orderBy('e.priority', 'ASC');
81 81
 
82
-        $result=$qb->getQuery()->getResult();
83
-        if(count($result)){
84
-             return $result[0]->getPriority() -1;
85
-        }else{
82
+        $result = $qb->getQuery()->getResult();
83
+        if (count($result)) {
84
+             return $result[0]->getPriority() - 1;
85
+        } else {
86 86
              return $range_start;
87 87
         }
88 88
 
89 89
     }
90 90
 
91
-    public function upPriority($pluginEventHandler,$up=true)
91
+    public function upPriority($pluginEventHandler, $up = true)
92 92
     {
93 93
 
94
-        list($range_start,$range_end) = $this->getPriorityRange($pluginEventHandler->getHandlerType());
94
+        list($range_start, $range_end) = $this->getPriorityRange($pluginEventHandler->getHandlerType());
95 95
 
96 96
         $qb = $this->createQueryBuilder('e');
97 97
 
98 98
         $qb->andWhere("e.priority >= $range_end ")
99 99
            ->andWhere("e.priority <= $range_start ")
100
-           ->andWhere('e.priority '.($up ?  '>' : '<' ).' :pri')
100
+           ->andWhere('e.priority '.($up ? '>' : '<').' :pri')
101 101
            ->andWhere('e.event = :event')
102
-           ->setParameter('event',$pluginEventHandler->getEvent())
103
-           ->setParameter('pri',  $pluginEventHandler->getPriority()  )
102
+           ->setParameter('event', $pluginEventHandler->getEvent())
103
+           ->setParameter('pri', $pluginEventHandler->getPriority())
104 104
            ->setMaxResults(1)
105
-           ->orderBy('e.priority', ($up ? 'ASC':'DESC' )  );
105
+           ->orderBy('e.priority', ($up ? 'ASC' : 'DESC'));
106 106
 
107
-        $result=$qb->getQuery()->getResult();
107
+        $result = $qb->getQuery()->getResult();
108 108
 
109
-        if(count($result)){
110
-            $em =$this->getEntityManager();
109
+        if (count($result)) {
110
+            $em = $this->getEntityManager();
111 111
             $em->getConnection()->beginTransaction();
112 112
             // 2個のentityのprioriryを入れ替える
113
-            $tmp=$pluginEventHandler->getPriority();
113
+            $tmp = $pluginEventHandler->getPriority();
114 114
             $pluginEventHandler->setPriority($result[0]->getPriority());
115 115
             $result[0]->setPriority($tmp);
116 116
             $em->persist($result[0]);
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
             $em->flush();
119 119
             $em->getConnection()->commit();
120 120
             # 移動する
121
-        }else{
121
+        } else {
122 122
             # 移動しない
123 123
             throw new PluginException("Can't swap");
124 124
         }
Please login to merge, or discard this patch.