@@ -99,7 +99,7 @@ |
||
99 | 99 | */ |
100 | 100 | public function registerContainerConfiguration(LoaderInterface $loader) |
101 | 101 | { |
102 | - $loader->load(__DIR__ . '/app/config/config.yml'); |
|
102 | + $loader->load(__DIR__.'/app/config/config.yml'); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | public function serialize() |
@@ -110,5 +110,5 @@ |
||
110 | 110 | return $this->getProduct()->getPrice(); |
111 | 111 | } |
112 | 112 | |
113 | - public function getProductAttribute(){} |
|
113 | + public function getProductAttribute() {} |
|
114 | 114 | } |
@@ -68,12 +68,12 @@ 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 SkuskuCustomerInterface) ) { |
|
76 | + if (!($customer instanceof SkuskuCustomerInterface)) { |
|
77 | 77 | $customer = null; |
78 | 78 | } |
79 | 79 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | ->getRepository('GGGGino\SkuskuCartBundle\Model\SkuskuCart') |
82 | 82 | ->getOneNonOrderedCartByCustomer($customer); |
83 | 83 | |
84 | - if ( !$cart ) { |
|
84 | + if (!$cart) { |
|
85 | 85 | $cart = $this->createNewCart($customer); |
86 | 86 | } |
87 | 87 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public function addProductToCartForm(Request $request, FormInterface $form) |
136 | 136 | { |
137 | - if ( $this->handled ) { |
|
137 | + if ($this->handled) { |
|
138 | 138 | return; |
139 | 139 | } |
140 | 140 | |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $this->em->persist($cart); |
183 | 183 | |
184 | 184 | /** @var SkuskuCartProduct $productCart */ |
185 | - if ( $productCart = $cart->getProduct($product)->first() ) { |
|
185 | + if ($productCart = $cart->getProduct($product)->first()) { |
|
186 | 186 | // @todo what?? $productCart->getQuantity() + $quantity |
187 | 187 | $productCart->setQuantity($productCart->getQuantity() + $quantity); |
188 | 188 | } else { |
@@ -30,7 +30,7 @@ |
||
30 | 30 | */ |
31 | 31 | public function getOneNonOrderedCartByCustomer(SkuskuCustomerInterface $customer = null) |
32 | 32 | { |
33 | - if ( !$customer ) { |
|
33 | + if (!$customer) { |
|
34 | 34 | return null; |
35 | 35 | } |
36 | 36 |
@@ -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 |
@@ -49,7 +49,7 @@ |
||
49 | 49 | /** @var SkuskuCurrencyInterface[] $Currencies */ |
50 | 50 | $currencies = $em->getRepository(SkuskuCurrencyInterface::class)->findAll(); |
51 | 51 | |
52 | - if ( count($currencies) > 0 ) { |
|
52 | + if (count($currencies) > 0) { |
|
53 | 53 | return 'Currency: <info> correct</info>'; |
54 | 54 | } else { |
55 | 55 | return 'Currency: <error>not correct</error>'; |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | |
62 | 62 | // If i make a mistake writing the class this enforce you to chose |
63 | 63 | // @todo now i'm forced to write thee entity namespace wth 2 backslash otherwise it will be removed |
64 | - if ( !in_array($input->getArgument('entity'), $abstractEntities) ) { |
|
65 | - $output->writeln('<error>Entity: ' . $input->getArgument('entity') . ' Not found</error>'); |
|
64 | + if (!in_array($input->getArgument('entity'), $abstractEntities)) { |
|
65 | + $output->writeln('<error>Entity: '.$input->getArgument('entity').' Not found</error>'); |
|
66 | 66 | $question = new ChoiceQuestion( |
67 | 67 | 'Please select the entity', |
68 | 68 | array_keys($abstractEntitiesInverted) |
@@ -93,11 +93,11 @@ discard block |
||
93 | 93 | |
94 | 94 | $classReflectedProps = $classReflected->getProperties(); |
95 | 95 | |
96 | - foreach($classReflectedProps as $key => $value) { |
|
97 | - $question = new Question('Set value for (' . $value->name . '): ', false); |
|
96 | + foreach ($classReflectedProps as $key => $value) { |
|
97 | + $question = new Question('Set value for ('.$value->name.'): ', false); |
|
98 | 98 | |
99 | 99 | $response = $helper->ask($input, $output, $question); |
100 | - if( !$response ){ |
|
100 | + if (!$response) { |
|
101 | 101 | continue; |
102 | 102 | } |
103 | 103 | $propertyAccessor->setValue($entityInstance, $value->name, $response); |
@@ -47,7 +47,7 @@ |
||
47 | 47 | 'disabled' => true |
48 | 48 | )); |
49 | 49 | |
50 | - $builder->addEventListener(FormEvents::POST_SET_DATA, function (FormEvent $event) { |
|
50 | + $builder->addEventListener(FormEvents::POST_SET_DATA, function(FormEvent $event) { |
|
51 | 51 | /** @var FormInterface $form */ |
52 | 52 | $form = $event->getForm(); |
53 | 53 |
@@ -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 |