Passed
Push — master ( 15fb0b...7beac6 )
by Matthijs
01:41
created
src/Services/Shop/Entity/Shop.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
     public function setThumbnailSquareSizesAttribute($value = null)
50 50
     {
51
-        $values  = explode(',', $value);
51
+        $values = explode(',', $value);
52 52
         $newValues = serialize($values);
53 53
         $this->attributes['thumbnail_square_sizes'] = $newValues;
54 54
     }
@@ -57,14 +57,14 @@  discard block
 block discarded – undo
57 57
     {
58 58
         if ($value) {
59 59
             $values = unserialize($value);
60
-            $newValues  = implode(',', $values);
60
+            $newValues = implode(',', $values);
61 61
             return $newValues;
62 62
         }
63 63
     }
64 64
 
65 65
     public function setThumbnailWidescreenSizesAttribute($value = null)
66 66
     {
67
-        $values  = explode(',', $value);
67
+        $values = explode(',', $value);
68 68
         $newValues = serialize($values);
69 69
         $this->attributes['thumbnail_widescreen_sizes'] = $newValues;
70 70
     }
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     {
74 74
         if ($value) {
75 75
             $values = unserialize($value);
76
-            $newValues  = implode(',', $values);
76
+            $newValues = implode(',', $values);
77 77
             return $newValues;
78 78
         }
79 79
     }
Please login to merge, or discard this patch.
src/Services/Product/ProductRelatedProductService.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@
 block discarded – undo
10 10
  
11 11
 class ProductRelatedProductService extends BaseService
12 12
 {
13
-	public function __construct(ProductRelatedProductRepository $productRelated)
14
-	{
15
-		$this->repo = $productRelated;
16
-	} 
13
+    public function __construct(ProductRelatedProductRepository $productRelated)
14
+    {
15
+        $this->repo = $productRelated;
16
+    } 
17 17
 
18 18
     public function create(array $attributes, $productParentId)
19 19
     {
Please login to merge, or discard this patch.
src/Services/Product/ProductExtraFieldValueService.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@
 block discarded – undo
10 10
  
11 11
 class ProductExtraFieldValueService extends BaseService
12 12
 {
13
-	public function __construct(ProductExtraFieldValueRepository $productExtraFieldValue)
14
-	{
15
-		$this->repo = $productExtraFieldValue;
16
-	} 
13
+    public function __construct(ProductExtraFieldValueRepository $productExtraFieldValue)
14
+    {
15
+        $this->repo = $productExtraFieldValue;
16
+    } 
17 17
 
18 18
     public function selectAllByProductId($productId)
19 19
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
             foreach ($attributes['rows'] as $row) {
36 36
                 $data = array();
37 37
 
38
-                $check  = $this->repo->getModel()->where('extra_field_id', '=', $row['extra_field_id'])->where('product_id', '=', $productId)->first();
38
+                $check = $this->repo->getModel()->where('extra_field_id', '=', $row['extra_field_id'])->where('product_id', '=', $productId)->first();
39 39
                 $data['shop_id'] = auth('hideyobackend')->user()->selected_shop_id;
40 40
                 if (!empty($row['extra_field_default_value_id']) or !empty($row['value'])) {
41 41
                     if ($check) {
Please login to merge, or discard this patch.
src/Services/Product/ProductTagGroupService.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -9,16 +9,16 @@
 block discarded – undo
9 9
  
10 10
 class ProductTagGroupService extends BaseService
11 11
 {
12
-	public function __construct(ProductTagGroupRepository $productTagGroup)
13
-	{
14
-		$this->repo = $productTagGroup;
15
-	} 
12
+    public function __construct(ProductTagGroupRepository $productTagGroup)
13
+    {
14
+        $this->repo = $productTagGroup;
15
+    } 
16 16
 
17
-	public function selectAllByTagAndShopId($shopId, $tag) {
18
-		return $this->repo->selectAllByTagAndShopId($shopId, $tag);
19
-	}
17
+    public function selectAllByTagAndShopId($shopId, $tag) {
18
+        return $this->repo->selectAllByTagAndShopId($shopId, $tag);
19
+    }
20 20
 
21
-  /**
21
+    /**
22 22
      * The validation rules for the model.
23 23
      *
24 24
      * @param  integer  $tagGroupId id attribute model    
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
         );
33 33
         
34 34
         if ($tagGroupId) {
35
-            $rules['tag'] =   'required|between:4,65|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$tagGroupId.' = id';
35
+            $rules['tag'] = 'required|between:4,65|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$tagGroupId.' = id';
36 36
         }
37 37
 
38 38
         return $rules;
Please login to merge, or discard this patch.
src/Services/Product/ProductService.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,16 +12,16 @@  discard block
 block discarded – undo
12 12
  
13 13
 class ProductService extends BaseService
14 14
 {
15
-	public function __construct(ProductRepository $product)
16
-	{
17
-		$this->repo = $product;
15
+    public function __construct(ProductRepository $product)
16
+    {
17
+        $this->repo = $product;
18 18
         $this->storageImagePath = storage_path() .config('hideyo.storage_path'). "/product/";
19 19
         $this->publicImagePath = public_path() .config('hideyo.public_path'). "/product/";
20 20
 
21
-	} 
21
+    } 
22 22
 
23 23
 
24
- /**
24
+    /**
25 25
      * The validation rules for the model.
26 26
      *
27 27
      * @param  integer  $productId id attribute model    
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
     }
483 483
 
484 484
 
485
-  public function increaseAmounts($products)
485
+    public function increaseAmounts($products)
486 486
     {
487 487
         if ($products->count()) {
488 488
             foreach ($products as $product) {
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
 
599 599
     public function selectOneByShopIdAndId($shopId, $productId, $attributeId = false)
600 600
     {
601
-       return $this->repo->selectOneByShopIdAndId($shopId, $productId, $attributeId);
601
+        return $this->repo->selectOneByShopIdAndId($shopId, $productId, $attributeId);
602 602
     }
603 603
 
604 604
     public function ajaxProductImages($product, $combinationsIds, $productAttributeId = false) 
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
 	public function __construct(ProductRepository $product)
16 16
 	{
17 17
 		$this->repo = $product;
18
-        $this->storageImagePath = storage_path() .config('hideyo.storage_path'). "/product/";
19
-        $this->publicImagePath = public_path() .config('hideyo.public_path'). "/product/";
18
+        $this->storageImagePath = storage_path().config('hideyo.storage_path')."/product/";
19
+        $this->publicImagePath = public_path().config('hideyo.public_path')."/product/";
20 20
 
21 21
 	} 
22 22
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             );
52 52
             
53 53
             if ($productId) {
54
-                $rules['title'] =   'required|between:4,65|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$productId.' = id';
54
+                $rules['title'] = 'required|between:4,65|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$productId.' = id';
55 55
             }
56 56
         }
57 57
 
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
             $discountPriceEx = $product->price;
368 368
             $discountTaxRate = 0;
369 369
 
370
-            if($preSaleDiscount) {
370
+            if ($preSaleDiscount) {
371 371
 
372 372
                 if ($preSaleDiscount['value'] AND $preSaleDiscount['collection_id'] == $product->collection_id) {
373 373
 
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
                     $discountTaxRate = $discountPriceInc - $discountPriceEx;                   
384 384
                 }
385 385
 
386
-                if($preSaleDiscount['products']) {
386
+                if ($preSaleDiscount['products']) {
387 387
 
388 388
                     $productIds = array_column($preSaleDiscount['products'], 'id');
389 389
 
@@ -449,11 +449,11 @@  discard block
 block discarded – undo
449 449
         $product = $product->has('productImages')->where('id', '=', $productId)->first();
450 450
         $images = array();
451 451
 
452
-        if($product AND $product->productImages->count()) {  
452
+        if ($product AND $product->productImages->count()) {  
453 453
 
454 454
             $images = $product->productImages()->has('relatedAttributes', '=', 0)->has('relatedProductAttributes', '=', 0)->orderBy('rank', '=', 'asc')->get();
455 455
 
456
-            if($combinationsIds) {
456
+            if ($combinationsIds) {
457 457
 
458 458
                 $imagesRelatedAttributes = $this->getImageModel()->
459 459
                 whereHas('relatedAttributes', function($query) use ($combinationsIds, $product, $productId) { $query->with(array('productImage'))->whereIn('attribute_id', $combinationsIds); });
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
                 $images = $images->merge($imagesRelatedAttributes)->sortBy('rank');          
462 462
             }
463 463
 
464
-            if($productAttributeId) {                
464
+            if ($productAttributeId) {                
465 465
                 $imagesRelatedProductAttributes = $this->getImageModel()->
466 466
                 whereHas('relatedProductAttributes', function($query) use ($productAttributeId, $product) { $query->where('product_attribute_id', '=', $productAttributeId); })
467 467
                 ->where('product_id', '=', $productId)
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
             }
472 472
 
473 473
 
474
-            if(!$images->count()) {
474
+            if (!$images->count()) {
475 475
                 $images = $product->productImages()->orderBy('rank', '=', 'asc')->get();
476 476
             }
477 477
 
Please login to merge, or discard this patch.
src/Services/Product/ProductCombinationService.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -9,12 +9,12 @@  discard block
 block discarded – undo
9 9
  
10 10
 class ProductCombinationService extends BaseService
11 11
 {
12
-	public function __construct(ProductCombinationRepository $productTagGroup)
13
-	{
14
-		$this->repo = $productTagGroup;
15
-	} 
12
+    public function __construct(ProductCombinationRepository $productTagGroup)
13
+    {
14
+        $this->repo = $productTagGroup;
15
+    } 
16 16
 
17
-   public function create(array $attributes, $productId)
17
+    public function create(array $attributes, $productId)
18 18
 {
19 19
         if (isset($attributes['selected_attribute_ids'])) {
20 20
             $check = $this->repo->getModelAttributeCombination()->leftJoin($this->repo->getModel()->getTable(), $this->repo->getModel()->getTable().'.id', '=', $this->repo->getModelAttributeCombination()->getTable().'.product_attribute_id')
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
         return $model;
145 145
     }
146 146
 
147
-	public function selectAllByProductCategoryId($productCategoryId, $shopId) {
148
-		return $this->repo->selectAllByProductCategoryId($productCategoryId, $shopId);
149
-	}
147
+    public function selectAllByProductCategoryId($productCategoryId, $shopId) {
148
+        return $this->repo->selectAllByProductCategoryId($productCategoryId, $shopId);
149
+    }
150 150
 
151 151
     public function generatePulldowns($product, $productAttributeId, $attributeLeadingGroup = false, $secondAttributeId = false) 
152 152
     {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
             ->where($this->repo->getModel()->getTable().'.product_id', '=', $productId);
22 22
 
23 23
             if (isset($attributes['selected_attribute_ids'])) {
24
-                $check->where(function ($query) use ($attributes) {
24
+                $check->where(function($query) use ($attributes) {
25 25
                     $query->whereIn($this->repo->getModelAttributeCombination()->getTable().'.attribute_id', $attributes['selected_attribute_ids']);
26 26
                 });
27 27
             }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             ->where($this->repo->getModel()->getTable().'.product_id', '=', $attributes['product_id']);
93 93
 
94 94
             if (isset($attributes['selected_attribute_ids'])) {
95
-                $check->where(function ($query) use ($attributes) {
95
+                $check->where(function($query) use ($attributes) {
96 96
                     $query->whereIn($this->repo->getModelAttributeCombination()->getTable().'.attribute_id', $attributes['selected_attribute_ids']);
97 97
                 });
98 98
             }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
                     $newData[$row['product_attribute_id']] = $row->productAttribute->combinations->toArray();
105 105
                 }
106 106
 
107
-                if(isset($attributes['selected_attribute_ids'])) {
107
+                if (isset($attributes['selected_attribute_ids'])) {
108 108
                 foreach ($newData as $row) {
109 109
                     if (count($row) == count($attributes['selected_attribute_ids'])) {
110 110
                         $i = 0;
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
             }
163 163
         }
164 164
 
165
-        if(!$productAttributeId AND $attributeLeadingGroup AND isset($newPullDowns[$attributeLeadingGroup->title])) {
165
+        if (!$productAttributeId AND $attributeLeadingGroup AND isset($newPullDowns[$attributeLeadingGroup->title])) {
166 166
             $productAttributeId = key($newPullDowns[$attributeLeadingGroup->title]);
167 167
         }
168 168
 
169
-        $productAttributeResultWithAttributeId =  $this->repo->getProductAttribute($product, $productAttributeId);   
169
+        $productAttributeResultWithAttributeId = $this->repo->getProductAttribute($product, $productAttributeId);   
170 170
 
171 171
         if ($productAttributeResultWithAttributeId->get()->first()) {
172 172
             foreach ($productAttributeResultWithAttributeId->get()->first()->combinations as $combination) {
Please login to merge, or discard this patch.
src/Services/Product/Entity/ProductWaitingListRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
         );
32 32
         
33 33
         if ($waitingListId) {
34
-            $rules['tag'] =   'required|between:4,65|unique_with:'.$this->model->getTable().', shop_id, '.$waitingListId.' = id';
34
+            $rules['tag'] = 'required|between:4,65|unique_with:'.$this->model->getTable().', shop_id, '.$waitingListId.' = id';
35 35
         }
36 36
 
37 37
         return $rules;
Please login to merge, or discard this patch.
src/Services/Product/Entity/ProductTagGroupRepository.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@
 block discarded – undo
20 20
 
21 21
     function selectAllByTagAndShopId($shopId, $tag)
22 22
     {
23
-        $result = $this->model->with(array('relatedProducts' => function ($query) {
24
-            $query->with(array('productCategory', 'productImages' => function ($query) {
23
+        $result = $this->model->with(array('relatedProducts' => function($query) {
24
+            $query->with(array('productCategory', 'productImages' => function($query) {
25 25
                 $query->orderBy('rank', 'asc');
26 26
             }))->where('active', '=', 1);
27 27
         }))->where('shop_id', '=', $shopId)->where('tag', '=', $tag)->get();
Please login to merge, or discard this patch.
src/Services/Product/Entity/ProductExtraFieldValueRepository.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -30,28 +30,28 @@
 block discarded – undo
30 30
 
31 31
     function selectOneByShopIdAndSlug($shopId, $slug)
32 32
     {
33
-           return $this->model->with(array('productCategory', 'productImages'))->where('shop_id', '=', $shopId)->where('slug', '=', $slug)->get()->first();
33
+            return $this->model->with(array('productCategory', 'productImages'))->where('shop_id', '=', $shopId)->where('slug', '=', $slug)->get()->first();
34 34
     }
35 35
 
36 36
     function selectOneByShopIdAndId($shopId, $id)
37 37
     {
38
-           return $this->model->with(array('productCategory', 'productImages'))->where('shop_id', '=', $shopId)->where('id', '=', $id)->get()->first();
38
+            return $this->model->with(array('productCategory', 'productImages'))->where('shop_id', '=', $shopId)->where('id', '=', $id)->get()->first();
39 39
     }
40 40
 
41 41
     function selectAllByProductCategoryId($productCategoryId, $shopId)
42 42
     {
43 43
 
44
-         return $this->model->
45
-         whereHas('product', function ($query) use ($productCategoryId, $shopId) {
44
+            return $this->model->
45
+            whereHas('product', function ($query) use ($productCategoryId, $shopId) {
46 46
             $query->where('product_category_id', '=', $productCategoryId);
47 47
             $query->where('active', '=', 1);
48 48
             $query->where('shop_id', '=', $shopId);
49
-         })->with(
50
-             array(
49
+            })->with(
50
+                array(
51 51
                 'extraFieldDefaultValue',
52 52
                 'extraField' => function ($q) {
53 53
                 }
54 54
                 )
55
-         )->get();
55
+            )->get();
56 56
     }
57 57
 }
58 58
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,14 +42,14 @@
 block discarded – undo
42 42
     {
43 43
 
44 44
          return $this->model->
45
-         whereHas('product', function ($query) use ($productCategoryId, $shopId) {
45
+         whereHas('product', function($query) use ($productCategoryId, $shopId) {
46 46
             $query->where('product_category_id', '=', $productCategoryId);
47 47
             $query->where('active', '=', 1);
48 48
             $query->where('shop_id', '=', $shopId);
49 49
          })->with(
50 50
              array(
51 51
                 'extraFieldDefaultValue',
52
-                'extraField' => function ($q) {
52
+                'extraField' => function($q) {
53 53
                 }
54 54
                 )
55 55
          )->get();
Please login to merge, or discard this patch.