@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | $qb = $this->createQueryBuilder('e') |
43 | 43 | ->innerJoin('e.Plugin', 'p') |
44 | 44 | ->andWhere('e.del_flg = 0 ') |
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,66 +52,66 @@ discard block |
||
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 | 100 | ->andWhere("e.del_flg = 0 ") |
101 | - ->andWhere('e.priority '.($up ? '>' : '<' ).' :pri') |
|
101 | + ->andWhere('e.priority '.($up ? '>' : '<').' :pri') |
|
102 | 102 | ->andWhere('e.event = :event') |
103 | - ->setParameter('event',$pluginEventHandler->getEvent()) |
|
104 | - ->setParameter('pri', $pluginEventHandler->getPriority() ) |
|
103 | + ->setParameter('event', $pluginEventHandler->getEvent()) |
|
104 | + ->setParameter('pri', $pluginEventHandler->getPriority()) |
|
105 | 105 | ->setMaxResults(1) |
106 | - ->orderBy('e.priority', ($up ? 'ASC':'DESC' ) ); |
|
106 | + ->orderBy('e.priority', ($up ? 'ASC' : 'DESC')); |
|
107 | 107 | |
108 | - $result=$qb->getQuery()->getResult(); |
|
108 | + $result = $qb->getQuery()->getResult(); |
|
109 | 109 | |
110 | - if(count($result)){ |
|
111 | - $em =$this->getEntityManager(); |
|
110 | + if (count($result)) { |
|
111 | + $em = $this->getEntityManager(); |
|
112 | 112 | $em->getConnection()->beginTransaction(); |
113 | 113 | // 2個のentityのprioriryを入れ替える |
114 | - $tmp=$pluginEventHandler->getPriority(); |
|
114 | + $tmp = $pluginEventHandler->getPriority(); |
|
115 | 115 | $pluginEventHandler->setPriority($result[0]->getPriority()); |
116 | 116 | $result[0]->setPriority($tmp); |
117 | 117 | $em->persist($result[0]); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $em->flush(); |
120 | 120 | $em->getConnection()->commit(); |
121 | 121 | # 移動する |
122 | - }else{ |
|
122 | + } else { |
|
123 | 123 | # 移動しない |
124 | 124 | throw new PluginException("Can't swap"); |
125 | 125 | } |
@@ -187,7 +187,7 @@ |
||
187 | 187 | $this->app['config']['block_default_realdir'], |
188 | 188 | ); |
189 | 189 | foreach ($readPaths as $readPath) { |
190 | - $filePath = $readPath . '/' . $fileName . '.twig'; |
|
190 | + $filePath = $readPath.'/'.$fileName.'.twig'; |
|
191 | 191 | $fs = new Filesystem(); |
192 | 192 | if ($fs->exists($filePath)) { |
193 | 193 | return array( |
@@ -108,7 +108,7 @@ |
||
108 | 108 | if ($driver == 'pdo_sqlite') { |
109 | 109 | return sprintf("CAST(STRFTIME('%s', %s) AS INTEGER)", $this->formats[$this->field], $this->source->dispatch($sqlWalker)); |
110 | 110 | } else { |
111 | - return sprintf('EXTRACT(%s FROM %s %s)', $this->field, (string)$this->type, $this->source->dispatch($sqlWalker)); |
|
111 | + return sprintf('EXTRACT(%s FROM %s %s)', $this->field, (string) $this->type, $this->source->dispatch($sqlWalker)); |
|
112 | 112 | } |
113 | 113 | } |
114 | 114 | } |
115 | 115 | \ No newline at end of file |
@@ -32,7 +32,7 @@ |
||
32 | 32 | public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias) |
33 | 33 | { |
34 | 34 | if ($targetEntity->reflClass->getName() === 'Eccube\Entity\ProductClass') { |
35 | - return $targetTableAlias . '.stock >= 1 OR ' . $targetTableAlias . '.stock_unlimited = 1'; |
|
35 | + return $targetTableAlias.'.stock >= 1 OR '.$targetTableAlias.'.stock_unlimited = 1'; |
|
36 | 36 | } else { |
37 | 37 | return ""; |
38 | 38 | } |
@@ -33,12 +33,12 @@ |
||
33 | 33 | { |
34 | 34 | // 決済処理中/購入処理中を除く. |
35 | 35 | if ($targetEntity->reflClass->getName() === 'Eccube\Entity\Order') { |
36 | - return $targetTableAlias . '.status <> 7 AND ' . $targetTableAlias . '.status <> 8'; |
|
36 | + return $targetTableAlias.'.status <> 7 AND '.$targetTableAlias.'.status <> 8'; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | // 決済処理中/購入処理中を除く. |
40 | 40 | if ($targetEntity->reflClass->getName() === 'Eccube\Entity\Master\OrderStatus') { |
41 | - return $targetTableAlias . '.id <> 7 AND ' . $targetTableAlias . '.id <> 8'; |
|
41 | + return $targetTableAlias.'.id <> 7 AND '.$targetTableAlias.'.id <> 8'; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | return ''; |
@@ -46,7 +46,7 @@ |
||
46 | 46 | public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias) |
47 | 47 | { |
48 | 48 | if ($targetEntity->hasField('del_flg') && !in_array($targetEntity->getName(), $this->getExcludes())) { |
49 | - return $targetTableAlias . '.del_flg = 0'; |
|
49 | + return $targetTableAlias.'.del_flg = 0'; |
|
50 | 50 | } else { |
51 | 51 | return ""; |
52 | 52 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | { |
29 | 29 | public function register(Application $app) |
30 | 30 | { |
31 | - $app['validator'] = $app->share(function ($app) { |
|
31 | + $app['validator'] = $app->share(function($app) { |
|
32 | 32 | |
33 | 33 | return new Validator( |
34 | 34 | $app['validator.mapping.class_metadata_factory'], |
@@ -39,17 +39,17 @@ discard block |
||
39 | 39 | ); |
40 | 40 | }); |
41 | 41 | |
42 | - $app['validator.mapping.class_metadata_factory'] = $app->share(function ($app) { |
|
42 | + $app['validator.mapping.class_metadata_factory'] = $app->share(function($app) { |
|
43 | 43 | return new ClassMetadataFactory(new StaticMethodLoader()); |
44 | 44 | }); |
45 | 45 | |
46 | - $app['validator.validator_factory'] = $app->share(function () use ($app) { |
|
46 | + $app['validator.validator_factory'] = $app->share(function() use ($app) { |
|
47 | 47 | $validators = isset($app['validator.validator_service_ids']) ? $app['validator.validator_service_ids'] : array(); |
48 | 48 | |
49 | 49 | return new ConstraintValidatorFactory($app, $validators); |
50 | 50 | }); |
51 | 51 | |
52 | - $app['validator.object_initializers'] = $app->share(function ($app) { |
|
52 | + $app['validator.object_initializers'] = $app->share(function($app) { |
|
53 | 53 | return array(); |
54 | 54 | }); |
55 | 55 | } |
@@ -40,13 +40,13 @@ |
||
40 | 40 | */ |
41 | 41 | public function register(BaseApplication $app) |
42 | 42 | { |
43 | - $app['form.type.extensions'] = $app->share($app->extend('form.type.extensions', function ($extensions) use ($app) { |
|
43 | + $app['form.type.extensions'] = $app->share($app->extend('form.type.extensions', function($extensions) use ($app) { |
|
44 | 44 | $extensions[] = new \Eccube\Form\Extension\HelpTypeExtension(); |
45 | 45 | |
46 | 46 | return $extensions; |
47 | 47 | })); |
48 | 48 | |
49 | - $app['form.types'] = $app->share($app->extend('form.types', function ($types) use ($app) { |
|
49 | + $app['form.types'] = $app->share($app->extend('form.types', function($types) use ($app) { |
|
50 | 50 | $types[] = new \Eccube\Form\Type\Install\Step1Type($app); |
51 | 51 | $types[] = new \Eccube\Form\Type\Install\Step3Type($app); |
52 | 52 | $types[] = new \Eccube\Form\Type\Install\Step4Type($app); |
@@ -45,7 +45,7 @@ |
||
45 | 45 | @trigger_error('The '.__METHOD__.' method is deprecated.', E_USER_DEPRECATED); |
46 | 46 | |
47 | 47 | $form = $app['form.factory'] |
48 | - ->createBuilder($app['eccube.form.type.' . $type], $app['eccube.entity.' . $type]) |
|
48 | + ->createBuilder($app['eccube.form.type.'.$type], $app['eccube.entity.'.$type]) |
|
49 | 49 | ->getForm(); |
50 | 50 | $form->handleRequest($app['request']); |
51 | 51 |