Passed
Push — master ( a90f2d...81a345 )
by Matthijs
01:41
created
src/Services/Cart/Entity/CartRepository.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -75,10 +75,10 @@  discard block
 block discarded – undo
75 75
                 }
76 76
 
77 77
                 Cart::update($productId, array(
78
-                  'quantity' => array(
79
-                      'relative' => false,
80
-                      'value' => $amount
81
-                  ),
78
+                    'quantity' => array(
79
+                        'relative' => false,
80
+                        'value' => $amount
81
+                    ),
82 82
                 ));
83 83
             } else {
84 84
                 Cart::remove($productId);
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 
145 145
                     if ($preSaleDiscount['discount_way'] == 'amount') {
146 146
                         $discountValue = "-".$preSaleDiscount->value;
147
-                      } elseif ($preSaleDiscount['discount_way'] == 'percent') {          
147
+                        } elseif ($preSaleDiscount['discount_way'] == 'percent') {          
148 148
                         $discountValue = "-".$preSaleDiscount['value']."%";                    
149 149
                     }                     
150 150
                 }
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
                     $productArray['reference_code'] = $productCombination->reference_code;
49 49
                 }
50 50
 
51
-                $productArray['product_images'] =     ProductService::ajaxProductImages($product, array($leadingAttributeId), $productAttributeId);
51
+                $productArray['product_images'] = ProductService::ajaxProductImages($product, array($leadingAttributeId), $productAttributeId);
52 52
             }
53 53
 
54 54
             if ($product->amountSeries()->where('active', '=', '1')->count()) {
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
                 $productArray['product_amount_series_range'] = $product->amountSeries()->where('active', '=', '1')->first()->range();
57 57
             }
58 58
 
59
-            if($productArray['price_details']['amount'] > 0) {
59
+            if ($productArray['price_details']['amount'] > 0) {
60 60
 
61
-                if($amount >= $productArray['price_details']['amount']) {
61
+                if ($amount >= $productArray['price_details']['amount']) {
62 62
                     $amount = $productArray['price_details']['amount'];
63 63
                 }
64 64
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
                 Cart::remove($productId);
73 73
             }
74 74
 
75
-            if(Cart::getConditionsByType('sending_method_country_price')->count()) {
75
+            if (Cart::getConditionsByType('sending_method_country_price')->count()) {
76 76
                 $this->updateSendingMethodCountryPrice(Cart::getConditionsByType('sending_method_country_price')->first()->getAttributes()['data']['sending_method_country_price_id']);  
77 77
             }
78 78
         }
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
                     $productArray['reference_code'] = $productCombination->reference_code;
113 113
                 }
114 114
 
115
-                $productArray['product_images'] =     ProductService::ajaxProductImages($product, array($leadingAttributeId, $productAttributeId));
115
+                $productArray['product_images'] = ProductService::ajaxProductImages($product, array($leadingAttributeId, $productAttributeId));
116 116
             }
117 117
 
118 118
             $productId = $productArray['id'];
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
             $discountValue = false;
125 125
 
126
-            if(session()->get('preSaleDiscount')) {
126
+            if (session()->get('preSaleDiscount')) {
127 127
                 $preSaleDiscount = session()->get('preSaleDiscount');             
128 128
 
129 129
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
                     }                     
138 138
                 }
139 139
 
140
-                if($preSaleDiscount['products']) {
140
+                if ($preSaleDiscount['products']) {
141 141
 
142 142
                     $productIds = array_column($preSaleDiscount['products'], 'id');
143 143
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
             }
164 164
 
165 165
             $discountCondition = array();
166
-            if($discountValue) {
166
+            if ($discountValue) {
167 167
 
168 168
                 $discountCondition = new \Hideyo\Ecommerce\Framework\Services\Cart\CartCondition(array(
169 169
                     'name' => 'Discount',
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
                 ));
174 174
             }
175 175
 
176
-            return Cart::add($productId, $productArray,  $amount, $discountCondition);
176
+            return Cart::add($productId, $productArray, $amount, $discountCondition);
177 177
         }
178 178
 
179 179
         return false;
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
         if (isset($sendingMethod->id)) {
187 187
             $sendingMethodArray = $sendingMethod->toArray();          
188 188
             $sendingMethodArray['price_details'] = $sendingMethod->getPriceDetails();
189
-            if($sendingMethod->relatedPaymentMethodsActive) {
189
+            if ($sendingMethod->relatedPaymentMethodsActive) {
190 190
                 $sendingMethodArray['related_payment_methods_list'] = $sendingMethod->relatedPaymentMethodsActive->pluck('title', 'id');                
191 191
             }
192 192
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
         $valueIncTax = $paymentMethodArray['price_details']['original_price_inc_tax'];
227 227
         $shop = ShopService::find(config()->get('app.shop_id'));
228 228
         $value = $valueIncTax;
229
-        $freeSending = ( $paymentMethodArray['no_price_from'] - Cart::getSubTotalWithTax());
229
+        $freeSending = ($paymentMethodArray['no_price_from'] - Cart::getSubTotalWithTax());
230 230
 
231 231
 
232 232
         if ($freeSending < 0) {
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
             $valueExTax = $sendingMethodArray['price_details']['original_price_ex_tax'];
280 280
             $valueIncTax = $sendingMethodArray['price_details']['original_price_inc_tax'];
281 281
             $value = $valueIncTax;
282
-            $freeSending = ( $sendingMethodArray['no_price_from'] - Cart::getSubTotalWithTax());
282
+            $freeSending = ($sendingMethodArray['no_price_from'] - Cart::getSubTotalWithTax());
283 283
       
284 284
             if ($freeSending < 0) {
285 285
                 $value = 0;
@@ -352,12 +352,12 @@  discard block
 block discarded – undo
352 352
         $couponData = array();
353 353
         $discountValue = 0;
354 354
 
355
-        if($coupon) {
355
+        if ($coupon) {
356 356
 
357 357
             $couponData = $coupon->toArray();
358
-            if($coupon->type == 'total_price') {
358
+            if ($coupon->type == 'total_price') {
359 359
 
360
-                if($coupon->discount_way == 'total') {
360
+                if ($coupon->discount_way == 'total') {
361 361
                     $discountValue = $coupon->value;
362 362
                 } elseif ($coupon->discount_way == 'percent') {
363 363
                     $discountValue = $coupon->value.'%';
@@ -366,9 +366,9 @@  discard block
 block discarded – undo
366 366
                 $this->setCouponCode($discountValue, $couponData, $couponCode);
367 367
             }
368 368
 
369
-            if($coupon->type == 'product') {
369
+            if ($coupon->type == 'product') {
370 370
 
371
-                if($coupon->products()->count()) {
371
+                if ($coupon->products()->count()) {
372 372
                     
373 373
                     foreach (Cart::getContent() as $row) {
374 374
 
@@ -376,9 +376,9 @@  discard block
 block discarded – undo
376 376
                         $explode = explode('-', $id);
377 377
                         $contains = $coupon->products->contains($explode[0]);
378 378
 
379
-                        if($contains) {
379
+                        if ($contains) {
380 380
 
381
-                            if($coupon->discount_way == 'total') {
381
+                            if ($coupon->discount_way == 'total') {
382 382
                                 $discountValue += $coupon->value;
383 383
                             } elseif ($coupon->discount_way == 'percent') {
384 384
                                 $value = $coupon->value / 100;                      
@@ -391,17 +391,17 @@  discard block
 block discarded – undo
391 391
                 }
392 392
             }
393 393
 
394
-            if($coupon->type == 'product_category') {
394
+            if ($coupon->type == 'product_category') {
395 395
 
396
-                if($coupon->productCategories()->count()) {
396
+                if ($coupon->productCategories()->count()) {
397 397
 
398 398
                     foreach (Cart::getContent()->sortBy('id')  as $row) {
399 399
 
400 400
                         $contains = $coupon->productCategories->contains($row['attributes']['product_category_id']);
401 401
 
402
-                        if($contains) {
402
+                        if ($contains) {
403 403
 
404
-                            if($coupon->discount_way == 'total') {
404
+                            if ($coupon->discount_way == 'total') {
405 405
                                 $discountValue += $coupon->value;
406 406
                             } elseif ($coupon->discount_way == 'percent') {
407 407
                                 $value = $coupon->value / 100;                      
@@ -415,16 +415,16 @@  discard block
 block discarded – undo
415 415
                 }
416 416
             }
417 417
 
418
-            if($coupon->type == 'sending_method') {
418
+            if ($coupon->type == 'sending_method') {
419 419
 
420
-                if($coupon->sendingMethodCountries()->count()) {
420
+                if ($coupon->sendingMethodCountries()->count()) {
421 421
 
422 422
                     foreach ($coupon->sendingMethodCountries as $country) {
423 423
 
424
-                        if(Cart::getConditionsByType('sending_method_country_price')){
425
-                            if($country->name == Cart::getConditionsByType('sending_method_country_price')->first()->getAttributes()['data']['sending_method_country_price']['name']) {
424
+                        if (Cart::getConditionsByType('sending_method_country_price')) {
425
+                            if ($country->name == Cart::getConditionsByType('sending_method_country_price')->first()->getAttributes()['data']['sending_method_country_price']['name']) {
426 426
 
427
-                                if($coupon->discount_way == 'total') {
427
+                                if ($coupon->discount_way == 'total') {
428 428
                                     $discountValue += $coupon->value;
429 429
                                 } elseif ($coupon->discount_way == 'percent') {
430 430
                                     $value = $coupon->value / 100; 
@@ -436,15 +436,15 @@  discard block
 block discarded – undo
436 436
 
437 437
                     $this->setCouponCode($discountValue, $couponData, $couponCode);
438 438
 
439
-                } elseif($coupon->sendingMethods()->count()) {
439
+                } elseif ($coupon->sendingMethods()->count()) {
440 440
 
441 441
                     foreach ($coupon->sendingMethods as $sendingMethod) {
442 442
 
443
-                        if(Cart::getConditionsByType('sending_cost')){
443
+                        if (Cart::getConditionsByType('sending_cost')) {
444 444
 
445
-                            if($sendingMethod->id == Cart::getConditionsByType('sending_cost')->first()->getAttributes()['data']['sending_method']['id']) {
445
+                            if ($sendingMethod->id == Cart::getConditionsByType('sending_cost')->first()->getAttributes()['data']['sending_method']['id']) {
446 446
 
447
-                                if($coupon->discount_way == 'total') {
447
+                                if ($coupon->discount_way == 'total') {
448 448
                                     $discountValue += $coupon->value;
449 449
                                 } elseif ($coupon->discount_way == 'percent') {
450 450
                                     $value = $coupon->value / 100; 
@@ -458,17 +458,17 @@  discard block
 block discarded – undo
458 458
                 }
459 459
             }
460 460
 
461
-            if($coupon->type == 'payment_method') {
461
+            if ($coupon->type == 'payment_method') {
462 462
 
463
-                if($coupon->paymentMethods()->count()) {
463
+                if ($coupon->paymentMethods()->count()) {
464 464
 
465 465
                     foreach ($coupon->paymentMethods as $paymentMethod) {
466 466
 
467
-                        if(Cart::getConditionsByType('payment_method')){
467
+                        if (Cart::getConditionsByType('payment_method')) {
468 468
 
469
-                            if($paymentMethod->id == Cart::getConditionsByType('payment_method')->first()->getAttributes()['data']['id']) {
469
+                            if ($paymentMethod->id == Cart::getConditionsByType('payment_method')->first()->getAttributes()['data']['id']) {
470 470
 
471
-                                if($coupon->discount_way == 'total') {
471
+                                if ($coupon->discount_way == 'total') {
472 472
                                     $discountValue += $coupon->value;
473 473
                                 } elseif ($coupon->discount_way == 'percent') {
474 474
                                     $value = $coupon->value / 100; 
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
         );
521 521
 
522 522
         foreach ($replace as $key => $val) {
523
-            $content = str_replace("[" . $key . "]", $val, $content);
523
+            $content = str_replace("[".$key."]", $val, $content);
524 524
         }
525 525
         $content = nl2br($content);
526 526
         return $content;
Please login to merge, or discard this patch.
src/Services/News/NewsService.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -9,24 +9,24 @@  discard block
 block discarded – undo
9 9
  
10 10
 class NewsService extends BaseService
11 11
 {
12
-	public function __construct(NewsRepository $news)
13
-	{
14
-		$this->repo = $news;
15
-	} 
12
+    public function __construct(NewsRepository $news)
13
+    {
14
+        $this->repo = $news;
15
+    } 
16 16
 
17 17
     public function selectByLimitAndOrderBy($shopId, $limit, $orderBy)
18 18
     {
19
-    	return $this->repo->selectByLimitAndOrderBy($shopId, $limit, $orderBy);
19
+        return $this->repo->selectByLimitAndOrderBy($shopId, $limit, $orderBy);
20 20
     }
21 21
 
22 22
     public function selectOneBySlug($shopId, $slug)
23 23
     {
24
-    	return $this->repo->selectOneBySlug($shopId, $slug);
24
+        return $this->repo->selectOneBySlug($shopId, $slug);
25 25
     }
26 26
 
27 27
     public function selectAllActiveGroupsByShopId($shopId)
28 28
     {
29
-    	return $this->repo->selectAllActiveGroupsByShopId($shopId);
29
+        return $this->repo->selectAllActiveGroupsByShopId($shopId);
30 30
     }
31 31
 
32 32
     public function findGroup($groupId)
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
     public function selectAllGroups()
53 53
     {
54
-       return $this->repo->selectAllGroups();
54
+        return $this->repo->selectAllGroups();
55 55
     }
56 56
 
57 57
 
Please login to merge, or discard this patch.
src/Services/News/Entity/NewsImage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
     protected $table = 'news_image';
15 15
 
16 16
     // Add the 'avatar' attachment to the fillable array so that it's mass-assignable on this model.
17
-    protected $fillable = ['news_id', 'file', 'extension', 'size', 'path', 'rank', 'tag', 'modified_by_user_id',];
17
+    protected $fillable = ['news_id', 'file', 'extension', 'size', 'path', 'rank', 'tag', 'modified_by_user_id', ];
18 18
 
19 19
     public function news()
20 20
     {
Please login to merge, or discard this patch.
src/Services/News/Entity/NewsRepository.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 
295 295
     public function selectAllGroups()
296 296
     {
297
-       return $this->model->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id)->get();
297
+        return $this->model->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id)->get();
298 298
     }
299 299
 
300 300
     public function findGroup($groupId)
@@ -325,12 +325,12 @@  discard block
 block discarded – undo
325 325
 
326 326
     function selectAllByBlogCategoryId($newsCategoryId)
327 327
     {
328
-           return $this->model->with(array('extraFields' => function ($query) {
329
-           }, 'taxRate', 'newsCategory',  'relatedBlogs' => function ($query) {
328
+            return $this->model->with(array('extraFields' => function ($query) {
329
+            }, 'taxRate', 'newsCategory',  'relatedBlogs' => function ($query) {
330 330
             $query->with('newsImages')->orderBy('rank', 'asc');
331
-           }, 'newsImages' => function ($query) {
331
+            }, 'newsImages' => function ($query) {
332 332
             $query->orderBy('rank', 'asc');
333
-           }))->where('active', '=', 1)->where('news_category_id', '=', $newsCategoryId)->get();
333
+            }))->where('active', '=', 1)->where('news_category_id', '=', $newsCategoryId)->get();
334 334
     }
335 335
 
336 336
     function selectOneById($shopId, $slug)
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 
345 345
     function selectAllActiveGroupsByShopId($shopId)
346 346
     {
347
-         return $this->modelGroup->where('shop_id', '=', $shopId)->where('active', '=', 1)->get();
347
+            return $this->modelGroup->where('shop_id', '=', $shopId)->where('active', '=', 1)->get();
348 348
     }
349 349
 
350 350
     function selectOneGroupByShopIdAndSlug($shopId, $slug)
@@ -376,9 +376,9 @@  discard block
 block discarded – undo
376 376
     {
377 377
         $dt = Carbon::now('Europe/Amsterdam');
378 378
 
379
-           $result = $this->model
380
-           ->where('shop_id', '=', $shopId)
381
-           ->where('published_at', '<=', $dt->toDateString('Y-m-d'));
379
+            $result = $this->model
380
+            ->where('shop_id', '=', $shopId)
381
+            ->where('published_at', '<=', $dt->toDateString('Y-m-d'));
382 382
 
383 383
             return array(
384 384
                 'totals' => $result->get()->count(),
@@ -392,12 +392,12 @@  discard block
 block discarded – undo
392 392
     {
393 393
         $dt = Carbon::now('Europe/Amsterdam');
394 394
 
395
-           $result = $this->model
396
-           ->where('shop_id', '=', $shopId)
397
-           ->where('published_at', '<=', $dt->toDateString('Y-m-d'))
398
-           ->whereHas('newsGroup', function ($query) use ($newsGroupSlug) {
395
+            $result = $this->model
396
+            ->where('shop_id', '=', $shopId)
397
+            ->where('published_at', '<=', $dt->toDateString('Y-m-d'))
398
+            ->whereHas('newsGroup', function ($query) use ($newsGroupSlug) {
399 399
             $query->where('slug', '=', $newsGroupSlug);
400
-           });
400
+            });
401 401
 
402 402
             return array(
403 403
                 'totals' => $result->get()->count(),
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
         $this->model = $model;
29 29
         $this->modelImage = $modelImage;
30 30
         $this->modelGroup = $modelGroup;
31
-        $this->storageImagePath = storage_path() .config('hideyo.storage_path'). "/news/";
32
-        $this->publicImagePath = public_path() .config('hideyo.public_path'). "/news/";
31
+        $this->storageImagePath = storage_path().config('hideyo.storage_path')."/news/";
32
+        $this->publicImagePath = public_path().config('hideyo.public_path')."/news/";
33 33
     }
34 34
   
35 35
     /**
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             );
51 51
             
52 52
             if ($newsId) {
53
-                $rules['title'] =   'required|between:4,65|unique:'.$this->model->getTable().',title,'.$newsId;
53
+                $rules['title'] = 'required|between:4,65|unique:'.$this->model->getTable().',title,'.$newsId;
54 54
             }
55 55
         }
56 56
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
             );
70 70
             
71 71
             if ($newsGroupId) {
72
-                $rules['title'] =   'required|between:4,65|unique:'.$this->modelGroup->getTable().',title,'.$newsGroupId;
72
+                $rules['title'] = 'required|between:4,65|unique:'.$this->modelGroup->getTable().',title,'.$newsGroupId;
73 73
             }
74 74
         }
75 75
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
             return $validator;
128 128
         } 
129 129
 
130
-        $filename =  str_replace(" ", "_", strtolower($attributes['file']->getClientOriginalName()));
130
+        $filename = str_replace(" ", "_", strtolower($attributes['file']->getClientOriginalName()));
131 131
         $uploadSuccess = $attributes['file']->move($destinationPath, $filename);
132 132
 
133 133
         if ($uploadSuccess) {
@@ -192,13 +192,13 @@  discard block
 block discarded – undo
192 192
 
193 193
                         if (!File::exists($this->publicImagePath.$valueImage."/".$productImage->news_id."/".$productImage->file)) {
194 194
                             if (File::exists($this->storageImagePath.$productImage->news_id."/".$productImage->file)) {
195
-                                $image = Image::make(storage_path() .config('hideyo.storage_path'). "//news/".$productImage->news_id."/".$productImage->file);
195
+                                $image = Image::make(storage_path().config('hideyo.storage_path')."//news/".$productImage->news_id."/".$productImage->file);
196 196
                                 $explode = explode('x', $valueImage);
197 197
                                 $image->fit($explode[0], $explode[1]);
198 198
                             
199 199
                                 $image->interlace();
200 200
 
201
-                                $image->save(public_path() .config('hideyo.storage_path'). "/news/".$valueImage."/".$productImage->news_id."/".$productImage->file);
201
+                                $image->save(public_path().config('hideyo.storage_path')."/news/".$valueImage."/".$productImage->news_id."/".$productImage->file);
202 202
                             }
203 203
                         }
204 204
                     }
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
             }
258 258
         }
259 259
 
260
-        $directory = app_path() . "/storage/files/news/".$this->model->id;
260
+        $directory = app_path()."/storage/files/news/".$this->model->id;
261 261
         File::deleteDirectory($directory);
262 262
 
263 263
         return $this->model->delete();
@@ -325,10 +325,10 @@  discard block
 block discarded – undo
325 325
 
326 326
     function selectAllByBlogCategoryId($newsCategoryId)
327 327
     {
328
-           return $this->model->with(array('extraFields' => function ($query) {
329
-           }, 'taxRate', 'newsCategory',  'relatedBlogs' => function ($query) {
328
+           return $this->model->with(array('extraFields' => function($query) {
329
+           }, 'taxRate', 'newsCategory', 'relatedBlogs' => function($query) {
330 330
             $query->with('newsImages')->orderBy('rank', 'asc');
331
-           }, 'newsImages' => function ($query) {
331
+           }, 'newsImages' => function($query) {
332 332
             $query->orderBy('rank', 'asc');
333 333
            }))->where('active', '=', 1)->where('news_category_id', '=', $newsCategoryId)->get();
334 334
     }
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
     function selectOneById($shopId, $slug)
337 337
     {
338 338
         $dt = Carbon::now('Europe/Amsterdam');
339
-        $result = $this->model->with(array('newsCategory', 'relatedBlogs', 'newsImages' => function ($query) {
339
+        $result = $this->model->with(array('newsCategory', 'relatedBlogs', 'newsImages' => function($query) {
340 340
             $query->orderBy('rank', 'asc');
341 341
         }))->where('published_at', '<=', $dt->toDateString('Y-m-d'))->where('active', '=', 1)->where('id', '=', $id)->get()->first();
342 342
         return $result;
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
         $dt = Carbon::now('Europe/Amsterdam');
363 363
 
364 364
         return $this->model->with(
365
-            array('newsImages' => function ($query) {
365
+            array('newsImages' => function($query) {
366 366
                 $query->orderBy('rank', 'asc');
367 367
             })
368 368
         )
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
            $result = $this->model
396 396
            ->where('shop_id', '=', $shopId)
397 397
            ->where('published_at', '<=', $dt->toDateString('Y-m-d'))
398
-           ->whereHas('newsGroup', function ($query) use ($newsGroupSlug) {
398
+           ->whereHas('newsGroup', function($query) use ($newsGroupSlug) {
399 399
             $query->where('slug', '=', $newsGroupSlug);
400 400
            });
401 401
 
Please login to merge, or discard this patch.
src/Services/ExtraField/ExtraFieldService.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@
 block discarded – undo
9 9
  
10 10
 class ExtraFieldService extends BaseService
11 11
 {
12
-	public function __construct(ExtraFieldRepository $extraField)
13
-	{
14
-		$this->repo = $extraField;
15
-	}
12
+    public function __construct(ExtraFieldRepository $extraField)
13
+    {
14
+        $this->repo = $extraField;
15
+    }
16 16
 
17 17
 
18 18
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
         );
46 46
         
47 47
         if ($extraFieldId) {
48
-            $rules['title'] =   'required|between:4,65|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$extraFieldId.' = id';
48
+            $rules['title'] = 'required|between:4,65|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$extraFieldId.' = id';
49 49
         }
50 50
 
51 51
         return $rules;
Please login to merge, or discard this patch.
src/Services/ExtraField/Entity/ExtraFieldRepository.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,10 +34,10 @@
 block discarded – undo
34 34
         return $this->model->select('extra_field.*')
35 35
         ->leftJoin('product_category_related_extra_field', 'extra_field.id', '=', 'product_category_related_extra_field.extra_field_id')
36 36
         
37
-        ->where(function ($query) use ($productCategoryId) {
37
+        ->where(function($query) use ($productCategoryId) {
38 38
 
39 39
             $query->where('all_products', '=', 1)
40
-            ->orWhereHas('categories', function ($query) use ($productCategoryId) {
40
+            ->orWhereHas('categories', function($query) use ($productCategoryId) {
41 41
 
42 42
                 $query->where('product_category_id', '=', $productCategoryId);
43 43
             });
Please login to merge, or discard this patch.
src/Services/SendingMethod/SendingMethodService.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@  discard block
 block discarded – undo
8 8
  
9 9
 class SendingMethodService extends BaseService
10 10
 {
11
-	public function __construct(SendingMethodRepository $sendingMethod)
12
-	{
13
-		$this->repo = $sendingMethod;
14
-	} 
11
+    public function __construct(SendingMethodRepository $sendingMethod)
12
+    {
13
+        $this->repo = $sendingMethod;
14
+    } 
15 15
 
16 16
     /**
17 17
      * The validation rules for the model.
@@ -125,14 +125,14 @@  discard block
 block discarded – undo
125 125
         return $model;
126 126
     }
127 127
 
128
-	public function selectAllActiveByShopId($shopId)
128
+    public function selectAllActiveByShopId($shopId)
129 129
     {
130
-    	return $this->repo->selectAllActiveByShopId($shopId);
130
+        return $this->repo->selectAllActiveByShopId($shopId);
131 131
     }
132 132
 
133
-	public function selectOneByShopIdAndId($shopId, $sendingMethodId)
133
+    public function selectOneByShopIdAndId($shopId, $sendingMethodId)
134 134
     {
135
-    	$result = $this->repo->selectOneByShopIdAndId($shopId, $sendingMethodId);
135
+        $result = $this->repo->selectOneByShopIdAndId($shopId, $sendingMethodId);
136 136
 
137 137
         if ($result->isEmpty()) {
138 138
             return false;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
             'maximal_weight'    => 'numeric|nullable'
30 30
         );
31 31
         
32
-        if($sendingMethodId) {
33
-            $rules['title'] =   $rules['title'].','.$sendingMethodId.' = id';
32
+        if ($sendingMethodId) {
33
+            $rules['title'] = $rules['title'].','.$sendingMethodId.' = id';
34 34
         }
35 35
 
36 36
         return $rules;
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
             'name' => 'required|between:4,65|unique_with:sending_method_country_price, sending_method_id'
45 45
         );
46 46
         
47
-        if($id) {
48
-            $rules['name'] =   'required|between:4,65|unique_with:sending_method_country_price, sending_method_id, '.$id.' = id';
47
+        if ($id) {
48
+            $rules['name'] = 'required|between:4,65|unique_with:sending_method_country_price, sending_method_id, '.$id.' = id';
49 49
         }
50 50
 
51 51
         return $rules;
Please login to merge, or discard this patch.
src/Services/SendingMethod/Entity/SendingMethodRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
     public function selectOneByShopIdAndId($shopId, $sendingMethodId)
22 22
     {
23 23
         return $this->model->with(
24
-            array('relatedPaymentMethods' => function ($query) {
24
+            array('relatedPaymentMethods' => function($query) {
25 25
                 $query->where('active', '=', 1);
26 26
             })
27 27
         )->where('shop_id', '=', $shopId)->where('active', '=', 1)
Please login to merge, or discard this patch.
src/Services/Brand/BrandService.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
 	public function __construct(BrandRepository $brand)
15 15
 	{
16 16
 		$this->repo = $brand;
17
-        $this->storageImagePath = storage_path() .config('hideyo.storage_path'). "/brand/";
18
-        $this->publicImagePath = public_path() .config('hideyo.public_path'). "/brand/";
17
+        $this->storageImagePath = storage_path().config('hideyo.storage_path')."/brand/";
18
+        $this->publicImagePath = public_path().config('hideyo.public_path')."/brand/";
19 19
 
20 20
 	} 
21 21
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         );
43 43
         
44 44
         if ($brandId) {
45
-            $rules['title'] =   $rules['title'].', '.$brandId.' = id';
45
+            $rules['title'] = $rules['title'].', '.$brandId.' = id';
46 46
         }
47 47
      
48 48
         return $rules;
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         $attributes['extension'] = $attributes['file']->getClientOriginalExtension();
91 91
         $attributes['size'] = $attributes['file']->getSize();
92 92
 
93
-        $filename =  str_replace(" ", "_", strtolower($attributes['file']->getClientOriginalName()));
93
+        $filename = str_replace(" ", "_", strtolower($attributes['file']->getClientOriginalName()));
94 94
         $uploadSuccess = $attributes['file']->move($destinationPath, $filename);
95 95
 
96 96
         if ($uploadSuccess) {
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
     {
141 141
         $this->model = $this->find($brandId);
142 142
 
143
-        if($this->model) {
143
+        if ($this->model) {
144 144
             $attributes['modified_by_user_id'] = auth('hideyobackend')->user()->id;
145 145
             $image = $this->findImage($imageId);
146 146
             $image->fill($attributes);
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
     {
203 203
         $result = $this->repo->getModelImage()->get();
204 204
         $shop = ShopService::find($shopId);
205
-        if($result AND $shop->thumbnail_square_sizes) {
205
+        if ($result AND $shop->thumbnail_square_sizes) {
206 206
             foreach ($result as $productImage) {
207 207
                 if ($shop->thumbnail_square_sizes) {
208 208
                     $sizes = explode(',', $shop->thumbnail_square_sizes);
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,13 +11,13 @@
 block discarded – undo
11 11
  
12 12
 class BrandService extends BaseService
13 13
 {
14
-	public function __construct(BrandRepository $brand)
15
-	{
16
-		$this->repo = $brand;
14
+    public function __construct(BrandRepository $brand)
15
+    {
16
+        $this->repo = $brand;
17 17
         $this->storageImagePath = storage_path() .config('hideyo.storage_path'). "/brand/";
18 18
         $this->publicImagePath = public_path() .config('hideyo.public_path'). "/brand/";
19 19
 
20
-	} 
20
+    } 
21 21
 
22 22
     /**
23 23
      * The validation rules for the model.
Please login to merge, or discard this patch.