Test Failed
Branch master (c17565)
by David
06:36
created
Service/CurrencyManager.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,8 +65,9 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
Service/CartManager.php 1 patch
Braces   +19 added lines, -13 removed lines patch added patch discarded remove patch
@@ -73,16 +73,19 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
DependencyInjection/Compiler/DoctrineRelatedPass.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,8 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
Command/DoctorDbCommand.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
 
52 52
         if( count($currencies) > 0 ) {
53 53
             return 'Currency: <info> correct</info>';
54
-        }else{
54
+        } else{
55 55
             return 'Currency: <error>not correct</error>';
56 56
         }
57 57
     }
Please login to merge, or discard this patch.
Exception/CurrencyNotFoundException.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,9 @@
 block discarded – undo
12 12
      */
13 13
     public function __construct($message = "", $code = 0, \Exception $previous = null)
14 14
     {
15
-        if( !empty($message) )
16
-            $message = ": " . $message;
15
+        if( !empty($message) ) {
16
+                    $message = ": " . $message;
17
+        }
17 18
 
18 19
         $finalMessage = sprintf("Currency not found, maybe the db table is empty%s", $message);
19 20
         parent::__construct($finalMessage, $code, $previous);
Please login to merge, or discard this patch.
Twig/CartExtension.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -98,8 +98,9 @@  discard block
 block discarded – undo
98 98
      */
99 99
     public function renderPreviewCart($template = null)
100 100
     {
101
-        if( !$template )
102
-            $template = $this->templatePreviewCart;
101
+        if( !$template ) {
102
+                    $template = $this->templatePreviewCart;
103
+        }
103 104
 
104 105
         /** @var SkuskuCart $cart */
105 106
         $cart = $this->cartManager->getCartFromCustomer();
@@ -117,8 +118,9 @@  discard block
 block discarded – undo
117 118
      */
118 119
     public function renderCurrencyCart($template = null)
119 120
     {
120
-        if( !$template )
121
-            $template = $this->templateCurrencyCart;
121
+        if( !$template ) {
122
+                    $template = $this->templateCurrencyCart;
123
+        }
122 124
 
123 125
         /** @var SkuskuCurrencyInterface[] $currencies */
124 126
         $currencies = $this->currencyManager->getActiveCurrencies();
@@ -137,8 +139,9 @@  discard block
 block discarded – undo
137 139
      */
138 140
     public function renderLangCart($template = null)
139 141
     {
140
-        if( !$template )
141
-            $template = $this->templateLangCart;
142
+        if( !$template ) {
143
+                    $template = $this->templateLangCart;
144
+        }
142 145
 
143 146
         /** @var SkuskuLangInterface[] $languages */
144 147
         $languages = $this->langManager->getActiveLanguages();
Please login to merge, or discard this patch.