Passed
Push — master ( 697d1a...ebeb83 )
by Matthijs
06:55
created
src/Services/BaseModel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 
20 20
         $instance = new static;
21 21
 
22
-        $query = $instance->where($saveTo, 'LIKE', $slug . '%');
22
+        $query = $instance->where($saveTo, 'LIKE', $slug.'%');
23 23
 
24 24
         // @overriden - changed this to scope unique slugs per user
25 25
         $query = $query->where('shop_id', $this->shop_id);
Please login to merge, or discard this patch.
src/Services/GeneralSetting/GeneralSettingService.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -9,17 +9,17 @@
 block discarded – undo
9 9
  
10 10
 class GeneralSettingService extends BaseService
11 11
 {
12
-	public function __construct(GeneralSettingRepository $generalSetting)
13
-	{
14
-		$this->repo = $generalSetting;
15
-	} 
16
-
17
- 	/**
18
-     * The validation rules for the model.
19
-     *
20
-     * @param  integer  $settingId id attribute model    
21
-     * @return array
22
-     */
12
+    public function __construct(GeneralSettingRepository $generalSetting)
13
+    {
14
+        $this->repo = $generalSetting;
15
+    } 
16
+
17
+        /**
18
+         * The validation rules for the model.
19
+         *
20
+         * @param  integer  $settingId id attribute model    
21
+         * @return array
22
+         */
23 23
     public function rules($settingId = false)
24 24
     {
25 25
         $rules = array(
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
         );
29 29
         
30 30
         if ($settingId) {
31
-            $rules['name'] =   $rules['name'].','.$settingId.' = id';
31
+            $rules['name'] = $rules['name'].','.$settingId.' = id';
32 32
         }
33 33
 
34 34
         return $rules;
Please login to merge, or discard this patch.
src/Services/GeneralSetting/Entity/GeneralSetting.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,5 +13,5 @@
 block discarded – undo
13 13
      */
14 14
     protected $table = 'general_setting';
15 15
 
16
-	protected $fillable = ['id', 'name', 'value', 'text_value', 'shop_id'];
16
+    protected $fillable = ['id', 'name', 'value', 'text_value', 'shop_id'];
17 17
 }
18 18
\ No newline at end of file
Please login to merge, or discard this patch.
src/Services/ProductCategory/ProductCategoryService.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
         return $rules;
39 39
     }
40 40
 
41
-	public function __construct(ProductCategoryRepository $productCategory)
42
-	{
43
-		$this->repo = $productCategory;
41
+    public function __construct(ProductCategoryRepository $productCategory)
42
+    {
43
+        $this->repo = $productCategory;
44 44
         $this->storageImagePath = storage_path() .config('hideyo.storage_path'). "/product_category/";
45 45
         $this->publicImagePath = public_path() .config('hideyo.public_path'). "/product_category/";
46
-	} 
46
+    } 
47 47
 
48 48
     public function create(array $attributes)
49 49
     {
@@ -286,22 +286,22 @@  discard block
 block discarded – undo
286 286
 
287 287
     public function selectOneByShopIdAndSlug($shopId, $slug, $imageTag = false)
288 288
     { 
289
-    	return $this->repo->selectOneByShopIdAndSlug($shopId, $slug, $imageTag);
289
+        return $this->repo->selectOneByShopIdAndSlug($shopId, $slug, $imageTag);
290 290
     }
291 291
 
292 292
     public function selectAllByShopIdAndRoot($shopId)
293 293
     {
294
-    	return $this->repo->selectAllByShopIdAndRoot($shopId);
294
+        return $this->repo->selectAllByShopIdAndRoot($shopId);
295 295
     }
296 296
 
297 297
     public function selectRootCategories($shopId, $imageTag)
298 298
     {
299
-    	return $this->repo->selectRootCategories($shopId, $imageTag);
299
+        return $this->repo->selectRootCategories($shopId, $imageTag);
300 300
     }
301 301
 
302 302
     public function selectCategoriesByParentId($shopId, $parentId, $imageTag = false)
303 303
     {
304
-    	return $this->repo->selectCategoriesByParentId($shopId, $parentId, $imageTag);
304
+        return $this->repo->selectCategoriesByParentId($shopId, $parentId, $imageTag);
305 305
     }
306 306
 
307 307
     public function selectAllProductPullDown()
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
             );
33 33
             
34 34
             if ($productCategoryId) {
35
-                $rules['title'] =   'required|between:4,65|unique_with:'.'product_category, shop_id, '.$productCategoryId.' = id';
35
+                $rules['title'] = 'required|between:4,65|unique_with:'.'product_category, shop_id, '.$productCategoryId.' = id';
36 36
             }
37 37
         }
38 38
         return $rules;
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
 	public function __construct(ProductCategoryRepository $productCategory)
42 42
 	{
43 43
 		$this->repo = $productCategory;
44
-        $this->storageImagePath = storage_path() .config('hideyo.storage_path'). "/product_category/";
45
-        $this->publicImagePath = public_path() .config('hideyo.public_path'). "/product_category/";
44
+        $this->storageImagePath = storage_path().config('hideyo.storage_path')."/product_category/";
45
+        $this->publicImagePath = public_path().config('hideyo.public_path')."/product_category/";
46 46
 	} 
47 47
 
48 48
     public function create(array $attributes)
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
         if ($validator->fails()) {
149 149
             return $validator;
150 150
         } else {
151
-            $filename =  str_replace(" ", "_", strtolower($attributes['file']->getClientOriginalName()));
151
+            $filename = str_replace(" ", "_", strtolower($attributes['file']->getClientOriginalName()));
152 152
             $uploadSuccess = $attributes['file']->move($destinationPath, $filename);
153 153
 
154 154
             if ($uploadSuccess) {
@@ -242,9 +242,9 @@  discard block
 block discarded – undo
242 242
             }
243 243
         }
244 244
 
245
-        $directory = storage_path() . "/app/files/product_category/".$this->model->id;
245
+        $directory = storage_path()."/app/files/product_category/".$this->model->id;
246 246
         File::deleteDirectory($directory);
247
-        File::deleteDirectory(public_path() . "/files/product_category/".$this->model->id);
247
+        File::deleteDirectory(public_path()."/files/product_category/".$this->model->id);
248 248
 
249 249
         if ($this->model->children()->count()) {
250 250
             foreach ($this->model->children()->get() as $child) {
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
     public function destroyImage($imageId)
261 261
     {
262 262
         $this->imageModel = $this->findImage($imageId);
263
-        $filename = storage_path() ."/app/files/product_category/".$this->imageModel->product_category_id."/".$this->imageModel->file;
263
+        $filename = storage_path()."/app/files/product_category/".$this->imageModel->product_category_id."/".$this->imageModel->file;
264 264
         $shopId = auth('hideyobackend')->user()->selected_shop_id;
265 265
         $shop = ShopService::find($shopId);
266 266
 
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
                 $sizes = explode(',', $shop->thumbnail_square_sizes);
271 271
                 if ($sizes) {
272 272
                     foreach ($sizes as $key => $value) {
273
-                        File::delete(public_path() . "/files/product_category/".$value."/".$this->imageModel->product_category_id."/".$this->imageModel->file);
273
+                        File::delete(public_path()."/files/product_category/".$value."/".$this->imageModel->product_category_id."/".$this->imageModel->file);
274 274
                     }
275 275
                 }
276 276
             }
Please login to merge, or discard this patch.
src/Services/ProductCategory/Entity/ProductCategoryImage.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@
 block discarded – undo
13 13
      */    
14 14
     protected $table = 'product_category_image';
15 15
 
16
-    protected $guarded =  array('file');
16
+    protected $guarded = array('file');
17 17
 
18 18
     // Add the 'avatar' attachment to the fillable array so that it's mass-assignable on this model.
19
-    protected $fillable = ['product_category_id', 'file', 'extension', 'size', 'path', 'rank', 'tag', 'modified_by_user_id',];
19
+    protected $fillable = ['product_category_id', 'file', 'extension', 'size', 'path', 'rank', 'tag', 'modified_by_user_id', ];
20 20
 }
21 21
\ No newline at end of file
Please login to merge, or discard this patch.
src/Services/ProductCategory/Entity/ProductCategory.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
         return [
27 27
             'slug' => [
28 28
                 'source' => 'title',
29
-                 'onUpdate' => true
29
+                    'onUpdate' => true
30 30
             ]
31 31
         ];
32 32
     }
@@ -41,11 +41,11 @@  discard block
 block discarded – undo
41 41
         parent::boot();
42 42
 
43 43
         static::moving(function ($node) {
44
-          // YOUR CODE HERE
44
+            // YOUR CODE HERE
45 45
         });
46 46
 
47 47
         static::moved(function ($node) {
48
-          // YOUR CODE HERE
48
+            // YOUR CODE HERE
49 49
         });
50 50
     }
51 51
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,11 +40,11 @@
 block discarded – undo
40 40
     {
41 41
         parent::boot();
42 42
 
43
-        static::moving(function ($node) {
43
+        static::moving(function($node) {
44 44
           // YOUR CODE HERE
45 45
         });
46 46
 
47
-        static::moved(function ($node) {
47
+        static::moved(function($node) {
48 48
           // YOUR CODE HERE
49 49
         });
50 50
     }
Please login to merge, or discard this patch.
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.