@@ -21,11 +21,11 @@ |
||
| 21 | 21 | || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1', '113.0.0.1'], true) || php_sapi_name() === 'cli-server') |
| 22 | 22 | ) { |
| 23 | 23 | header('HTTP/1.0 403 Forbidden'); |
| 24 | - exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.'); |
|
| 24 | + exit('You are not allowed to access this file. Check ' . basename(__FILE__) . ' for more information.'); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | -require_once __DIR__.'/../app/bootstrap.php.cache'; |
|
| 28 | -require_once __DIR__.'/../app/AppKernel.php'; |
|
| 27 | +require_once __DIR__ . '/../app/bootstrap.php.cache'; |
|
| 28 | +require_once __DIR__ . '/../app/AppKernel.php'; |
|
| 29 | 29 | |
| 30 | 30 | $kernel = new AppKernel('test_cached', false); |
| 31 | 31 | $kernel->loadClassCache(); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | $province = $this->provinceRepository->findOneBy(['code' => $address->getProvinceCode()]); |
| 51 | - Assert::notNull($province,sprintf('Province with code "%s" not found.', $address->getProvinceCode())); |
|
| 51 | + Assert::notNull($province, sprintf('Province with code "%s" not found.', $address->getProvinceCode())); |
|
| 52 | 52 | |
| 53 | 53 | return $province->getName(); |
| 54 | 54 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | $province = $this->provinceRepository->findOneBy(['code' => $address->getProvinceCode()]); |
| 70 | - Assert::notNull($province,sprintf('Province with code "%s" not found.', $address->getProvinceCode())); |
|
| 70 | + Assert::notNull($province, sprintf('Province with code "%s" not found.', $address->getProvinceCode())); |
|
| 71 | 71 | |
| 72 | 72 | return $province->getAbbreviation() ?: $province->getName(); |
| 73 | 73 | } |
@@ -137,7 +137,7 @@ |
||
| 137 | 137 | $messages = []; |
| 138 | 138 | |
| 139 | 139 | /** @var SplFileInfo $file */ |
| 140 | - foreach($finder as $file) { |
|
| 140 | + foreach ($finder as $file) { |
|
| 141 | 141 | $messages[] = unserialize($file->getContents()); |
| 142 | 142 | } |
| 143 | 143 | |
@@ -92,10 +92,10 @@ |
||
| 92 | 92 | $string .= '('; |
| 93 | 93 | |
| 94 | 94 | foreach ($this->getOptionValues() as $option) { |
| 95 | - $string .= $option->getOption()->getName().': '.$option->getValue().', '; |
|
| 95 | + $string .= $option->getOption()->getName() . ': ' . $option->getValue() . ', '; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - $string = substr($string, 0, -2).')'; |
|
| 98 | + $string = substr($string, 0, -2) . ')'; |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | return $string; |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | |
| 54 | 54 | public function cancel() |
| 55 | 55 | { |
| 56 | - $expiredUnpaidOrders = $this->orderRepository->findOrdersUnpaidSince(new \DateTime('-'.$this->expirationPeriod)); |
|
| 56 | + $expiredUnpaidOrders = $this->orderRepository->findOrdersUnpaidSince(new \DateTime('-' . $this->expirationPeriod)); |
|
| 57 | 57 | foreach ($expiredUnpaidOrders as $expiredUnpaidOrder) { |
| 58 | 58 | $this->cancelOrder($expiredUnpaidOrder); |
| 59 | 59 | } |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | |
| 41 | 41 | public function remove() |
| 42 | 42 | { |
| 43 | - $expiredCarts = $this->orderRepository->findCartsNotModifiedSince(new \DateTime('-'.$this->expirationPeriod)); |
|
| 43 | + $expiredCarts = $this->orderRepository->findCartsNotModifiedSince(new \DateTime('-' . $this->expirationPeriod)); |
|
| 44 | 44 | foreach ($expiredCarts as $expiredCart) { |
| 45 | 45 | $this->orderRepository->remove($expiredCart); |
| 46 | 46 | } |
@@ -120,7 +120,7 @@ |
||
| 120 | 120 | $filesPath = $this->getParameter('files_path'); |
| 121 | 121 | |
| 122 | 122 | $taxonImage = $this->taxonImageFactory->createNew(); |
| 123 | - $taxonImage->setFile(new UploadedFile($filesPath.$imagePath, basename($imagePath))); |
|
| 123 | + $taxonImage->setFile(new UploadedFile($filesPath . $imagePath, basename($imagePath))); |
|
| 124 | 124 | $taxonImage->setCode($imageCode); |
| 125 | 125 | $this->imageUploader->upload($taxonImage); |
| 126 | 126 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | public function storeAllowsPaying($paymentMethodName) |
| 89 | 89 | { |
| 90 | - $this->createPaymentMethodFromNameAndCode($paymentMethodName, 'PM_'.$paymentMethodName, 'Payment method'); |
|
| 90 | + $this->createPaymentMethodFromNameAndCode($paymentMethodName, 'PM_' . $paymentMethodName, 'Payment method'); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | */ |
| 140 | 140 | public function theStoreHasPaymentMethodNotAssignedToAnyChannel($paymentMethodName) |
| 141 | 141 | { |
| 142 | - $this->createPaymentMethodFromNameAndCode($paymentMethodName, 'PM_'.$paymentMethodName, 'Payment method', false); |
|
| 142 | + $this->createPaymentMethodFromNameAndCode($paymentMethodName, 'PM_' . $paymentMethodName, 'Payment method', false); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | /** |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | { |
| 170 | 170 | $product = $this->createProduct($productName, $price); |
| 171 | 171 | |
| 172 | - $product->setDescription('Awesome '.$productName); |
|
| 172 | + $product->setDescription('Awesome ' . $productName); |
|
| 173 | 173 | |
| 174 | 174 | if ($this->sharedStorage->has('channel')) { |
| 175 | 175 | $product->addChannel($this->sharedStorage->get('channel')); |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | |
| 221 | 221 | $product->setName($productName); |
| 222 | 222 | $product->setCode($this->convertToCode($productName)); |
| 223 | - $product->setDescription('Awesome '.$productName); |
|
| 223 | + $product->setDescription('Awesome ' . $productName); |
|
| 224 | 224 | |
| 225 | 225 | if ($this->sharedStorage->has('channel')) { |
| 226 | 226 | $channel = $this->sharedStorage->get('channel'); |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | */ |
| 323 | 323 | public function thisProductHasAttributeWithValue(ProductInterface $product, $productAttributeType, $productAttributeName, $value) |
| 324 | 324 | { |
| 325 | - $attribute = $this->createProductAttribute($productAttributeType,$productAttributeName); |
|
| 325 | + $attribute = $this->createProductAttribute($productAttributeType, $productAttributeName); |
|
| 326 | 326 | $attributeValue = $this->createProductAttributeValue($value, $attribute); |
| 327 | 327 | $product->addAttribute($attributeValue); |
| 328 | 328 | |
@@ -334,8 +334,8 @@ discard block |
||
| 334 | 334 | */ |
| 335 | 335 | public function thisProductHasPercentAttributeWithValue(ProductInterface $product, $productAttributeName, $value) |
| 336 | 336 | { |
| 337 | - $attribute = $this->createProductAttribute('percent',$productAttributeName); |
|
| 338 | - $attributeValue = $this->createProductAttributeValue($value/100, $attribute); |
|
| 337 | + $attribute = $this->createProductAttribute('percent', $productAttributeName); |
|
| 338 | + $attributeValue = $this->createProductAttributeValue($value / 100, $attribute); |
|
| 339 | 339 | $product->addAttribute($attributeValue); |
| 340 | 340 | |
| 341 | 341 | $this->objectManager->flush(); |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | |
| 533 | 533 | /** @var ImageInterface $productImage */ |
| 534 | 534 | $productImage = $this->productImageFactory->createNew(); |
| 535 | - $productImage->setFile(new UploadedFile($filesPath.$imagePath, basename($imagePath))); |
|
| 535 | + $productImage->setFile(new UploadedFile($filesPath . $imagePath, basename($imagePath))); |
|
| 536 | 536 | $productImage->setCode($imageCode); |
| 537 | 537 | $this->imageUploader->upload($productImage); |
| 538 | 538 | |