@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | $response = $flow->handleSubmit($form, $formData); |
59 | 59 | |
60 | - if( $response instanceof RedirectResponse ){ |
|
60 | + if ($response instanceof RedirectResponse) { |
|
61 | 61 | return $response; |
62 | 62 | } |
63 | 63 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | $flow->handleDone($payment, $status); |
121 | 121 | |
122 | - if( $this->container->hasParameter('ggggino_skuskucart.templates.done_layout') ) { |
|
122 | + if ($this->container->hasParameter('ggggino_skuskucart.templates.done_layout')) { |
|
123 | 123 | return $this->render($this->container->getParameter('ggggino_skuskucart.templates.done_layout'), array( |
124 | 124 | 'status' => $status, |
125 | 125 | 'payment' => $payment |
@@ -35,7 +35,7 @@ |
||
35 | 35 | ->findAll(); |
36 | 36 | |
37 | 37 | /** @var SkuskuProductInterface $product */ |
38 | - foreach($products as $product) { |
|
38 | + foreach ($products as $product) { |
|
39 | 39 | /** @var Form $addToCartForm */ |
40 | 40 | $addToCartForm = $this->createForm(AddToCartType::class, array( |
41 | 41 | 'idProduct' => $product->getId() |
@@ -40,7 +40,7 @@ |
||
40 | 40 | { |
41 | 41 | $resultArray = array(); |
42 | 42 | |
43 | - foreach($this->getAbstractEntities() as $key => $value){ |
|
43 | + foreach ($this->getAbstractEntities() as $key => $value) { |
|
44 | 44 | $resultArray[] = array( |
45 | 45 | 'interface' => $key, |
46 | 46 | 'concrete' => $value |
@@ -65,7 +65,7 @@ |
||
65 | 65 | /** @var SkuskuCurrencyInterface $locale */ |
66 | 66 | $locale = $this->em->getRepository(SkuskuCurrencyInterface::class)->findOneByIsoCode($currencyIdentifier); |
67 | 67 | |
68 | - if( !$locale ) |
|
68 | + if (!$locale) |
|
69 | 69 | throw new CurrencyNotFoundException(); |
70 | 70 | |
71 | 71 | return $locale; |
@@ -65,8 +65,9 @@ |
||
65 | 65 | /** @var SkuskuCurrencyInterface $locale */ |
66 | 66 | $locale = $this->em->getRepository(SkuskuCurrencyInterface::class)->findOneByIsoCode($currencyIdentifier); |
67 | 67 | |
68 | - if( !$locale ) |
|
69 | - throw new CurrencyNotFoundException(); |
|
68 | + if( !$locale ) { |
|
69 | + throw new CurrencyNotFoundException(); |
|
70 | + } |
|
70 | 71 | |
71 | 72 | return $locale; |
72 | 73 | } |
@@ -68,20 +68,20 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function getCartFromCustomer(SkuskuCustomerInterface $customer = null) |
70 | 70 | { |
71 | - if( !$customer ) { |
|
71 | + if (!$customer) { |
|
72 | 72 | $customer = $this->tokenStorage->getToken()->getUser(); |
73 | 73 | } |
74 | 74 | |
75 | 75 | // If the user is anon. the arg $customer is a string, so i check it |
76 | - if( !($customer instanceof UserInterface) ) |
|
76 | + if (!($customer instanceof UserInterface)) |
|
77 | 77 | $customer = null; |
78 | 78 | |
79 | - if( !$this->allowAnonymous && !$customer ) |
|
79 | + if (!$this->allowAnonymous && !$customer) |
|
80 | 80 | throw new AccessDeniedException("Anonymous users cannot buy"); |
81 | 81 | |
82 | 82 | $cart = $this->em->getRepository('GGGGino\SkuskuCartBundle\Model\SkuskuCart')->findOneByCustomer($customer); |
83 | 83 | |
84 | - if( !$cart ) |
|
84 | + if (!$cart) |
|
85 | 85 | $cart = $this->createNewCart(); |
86 | 86 | |
87 | 87 | return $cart; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | public function addProductToCartForm(Request $request, FormInterface $form) |
135 | 135 | { |
136 | - if( $this->handled ) |
|
136 | + if ($this->handled) |
|
137 | 137 | return; |
138 | 138 | |
139 | 139 | $form->handleRequest($request); |
@@ -149,10 +149,10 @@ discard block |
||
149 | 149 | /** @var SkuskuProductInterface $productReference */ |
150 | 150 | $productReference = $this->em->getReference(SkuskuProductInterface::class, $idProduct); |
151 | 151 | |
152 | - if( !($customer instanceof UserInterface) ) |
|
152 | + if (!($customer instanceof UserInterface)) |
|
153 | 153 | $customer = null; |
154 | 154 | |
155 | - if( !$this->allowAnonymous && !$customer ) |
|
155 | + if (!$this->allowAnonymous && !$customer) |
|
156 | 156 | throw new AccessDeniedException("Anonymous users cannot buy"); |
157 | 157 | |
158 | 158 | $this->addProductToCart($productReference, $quantity); |
@@ -183,10 +183,10 @@ discard block |
||
183 | 183 | $this->em->persist($cart); |
184 | 184 | |
185 | 185 | /** @var SkuskuCartProduct $productCart */ |
186 | - if( $productCart = $cart->getProduct($product)->first() ){ |
|
186 | + if ($productCart = $cart->getProduct($product)->first()) { |
|
187 | 187 | // @todo what?? $productCart->getQuantity() + $quantity |
188 | 188 | $productCart->setQuantity($productCart->getQuantity() + $quantity); |
189 | - }else{ |
|
189 | + } else { |
|
190 | 190 | $productCart = new SkuskuCartProduct(); |
191 | 191 | $productCart->setProduct($product); |
192 | 192 | $productCart->setQuantity($quantity); |
@@ -73,16 +73,19 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | // If the user is anon. the arg $customer is a string, so i check it |
76 | - if( !($customer instanceof UserInterface) ) |
|
77 | - $customer = null; |
|
76 | + if( !($customer instanceof UserInterface) ) { |
|
77 | + $customer = null; |
|
78 | + } |
|
78 | 79 | |
79 | - if( !$this->allowAnonymous && !$customer ) |
|
80 | - throw new AccessDeniedException("Anonymous users cannot buy"); |
|
80 | + if( !$this->allowAnonymous && !$customer ) { |
|
81 | + throw new AccessDeniedException("Anonymous users cannot buy"); |
|
82 | + } |
|
81 | 83 | |
82 | 84 | $cart = $this->em->getRepository('GGGGino\SkuskuCartBundle\Model\SkuskuCart')->findOneByCustomer($customer); |
83 | 85 | |
84 | - if( !$cart ) |
|
85 | - $cart = $this->createNewCart(); |
|
86 | + if( !$cart ) { |
|
87 | + $cart = $this->createNewCart(); |
|
88 | + } |
|
86 | 89 | |
87 | 90 | return $cart; |
88 | 91 | } |
@@ -133,8 +136,9 @@ discard block |
||
133 | 136 | */ |
134 | 137 | public function addProductToCartForm(Request $request, FormInterface $form) |
135 | 138 | { |
136 | - if( $this->handled ) |
|
137 | - return; |
|
139 | + if( $this->handled ) { |
|
140 | + return; |
|
141 | + } |
|
138 | 142 | |
139 | 143 | $form->handleRequest($request); |
140 | 144 | |
@@ -149,11 +153,13 @@ discard block |
||
149 | 153 | /** @var SkuskuProductInterface $productReference */ |
150 | 154 | $productReference = $this->em->getReference(SkuskuProductInterface::class, $idProduct); |
151 | 155 | |
152 | - if( !($customer instanceof UserInterface) ) |
|
153 | - $customer = null; |
|
156 | + if( !($customer instanceof UserInterface) ) { |
|
157 | + $customer = null; |
|
158 | + } |
|
154 | 159 | |
155 | - if( !$this->allowAnonymous && !$customer ) |
|
156 | - throw new AccessDeniedException("Anonymous users cannot buy"); |
|
160 | + if( !$this->allowAnonymous && !$customer ) { |
|
161 | + throw new AccessDeniedException("Anonymous users cannot buy"); |
|
162 | + } |
|
157 | 163 | |
158 | 164 | $this->addProductToCart($productReference, $quantity); |
159 | 165 | } |
@@ -186,7 +192,7 @@ discard block |
||
186 | 192 | if( $productCart = $cart->getProduct($product)->first() ){ |
187 | 193 | // @todo what?? $productCart->getQuantity() + $quantity |
188 | 194 | $productCart->setQuantity($productCart->getQuantity() + $quantity); |
189 | - }else{ |
|
195 | + } else{ |
|
190 | 196 | $productCart = new SkuskuCartProduct(); |
191 | 197 | $productCart->setProduct($product); |
192 | 198 | $productCart->setQuantity($quantity); |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | |
32 | 32 | $container->setParameter('ggggino_skuskucart.stepform_class', $config['stepform_class']); |
33 | 33 | |
34 | - foreach($config['templates'] as $key => $template) { |
|
35 | - $container->setParameter('ggggino_skuskucart.templates.' . $key, $template); |
|
34 | + foreach ($config['templates'] as $key => $template) { |
|
35 | + $container->setParameter('ggggino_skuskucart.templates.'.$key, $template); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | private function prependPayumGateway(ContainerBuilder $container) |
97 | 97 | { |
98 | - if( !$container->hasExtension('payum') ){ |
|
98 | + if (!$container->hasExtension('payum')) { |
|
99 | 99 | die('non ce payum'); |
100 | 100 | } |
101 | 101 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $arrayEntities = $arrayEntities['gateways']; |
111 | 111 | $finalEntities = array(); |
112 | 112 | |
113 | - foreach( $arrayEntities as $key => $value ){ |
|
113 | + foreach ($arrayEntities as $key => $value) { |
|
114 | 114 | $labelName = isset($value['name']) ? $value['name'] : $key; |
115 | 115 | $finalEntities[$labelName] = $key; |
116 | 116 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | */ |
19 | 19 | public function process(ContainerBuilder $container) |
20 | 20 | { |
21 | - if( !$container->hasDefinition('doctrine.orm.listeners.resolve_target_entity') ) |
|
21 | + if (!$container->hasDefinition('doctrine.orm.listeners.resolve_target_entity')) |
|
22 | 22 | return; |
23 | 23 | } |
24 | 24 | } |
25 | 25 | \ No newline at end of file |
@@ -18,7 +18,8 @@ |
||
18 | 18 | */ |
19 | 19 | public function process(ContainerBuilder $container) |
20 | 20 | { |
21 | - if( !$container->hasDefinition('doctrine.orm.listeners.resolve_target_entity') ) |
|
22 | - return; |
|
21 | + if( !$container->hasDefinition('doctrine.orm.listeners.resolve_target_entity') ) { |
|
22 | + return; |
|
23 | + } |
|
23 | 24 | } |
24 | 25 | } |
25 | 26 | \ No newline at end of file |
@@ -10,5 +10,5 @@ |
||
10 | 10 | */ |
11 | 11 | class CartRepository extends \Doctrine\ORM\EntityRepository |
12 | 12 | { |
13 | - public function findByUser(){} |
|
13 | + public function findByUser() {} |
|
14 | 14 | } |
@@ -10,5 +10,5 @@ |
||
10 | 10 | */ |
11 | 11 | class OrderRepository extends \Doctrine\ORM\EntityRepository |
12 | 12 | { |
13 | - public function findByUser(){} |
|
13 | + public function findByUser() {} |
|
14 | 14 | } |