Passed
Branch master (bda0ff)
by Matthijs
02:31
created
src/Services/PaymentMethod/PaymentMethodService.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,14 +9,14 @@
 block discarded – undo
9 9
  
10 10
 class PaymentMethodService extends BaseService
11 11
 {
12
-	public function __construct(PaymentMethodRepository $paymentMethod)
13
-	{
14
-		$this->repo = $paymentMethod;
15
-	}
12
+    public function __construct(PaymentMethodRepository $paymentMethod)
13
+    {
14
+        $this->repo = $paymentMethod;
15
+    }
16 16
 
17 17
     public function selectOneByShopIdAndId($shopId, $paymentMethodId)
18 18
     {
19
-    	$result = $this->repo->selectOneByShopIdAndId($shopId, $paymentMethodId);
19
+        $result = $this->repo->selectOneByShopIdAndId($shopId, $paymentMethodId);
20 20
 
21 21
         if ($result->isEmpty()) {
22 22
             return false;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
         );
40 40
         
41 41
         if ($paymentMethodId) {
42
-            $rules['title'] =   $rules['title'].','.$paymentMethodId.' = id';
42
+            $rules['title'] = $rules['title'].','.$paymentMethodId.' = id';
43 43
         }
44 44
 
45 45
         return $rules;
Please login to merge, or discard this patch.
src/Services/PaymentMethod/Entity/PaymentMethod.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
     protected $table = 'payment_method';
16 16
 
17 17
     // Add the 'avatar' attachment to the fillable array so that it's mass-assignable on this model.
18
-    protected $fillable = ['total_price_discount_type', 'total_price_discount_value', 'total_price_discount_start_date', 'total_price_discount_end_date',  'active', 'percent_of_total', 'price', 'no_price_from', 'payment_external', 'title', 'shop_id', 'tax_rate_id', 'mollie_external_payment_way', 'order_confirmed_order_status_id', 'payment_completed_order_status_id',  'payment_failed_order_status_id', 'mollie_api_key', 'modified_by_user_id'];
18
+    protected $fillable = ['total_price_discount_type', 'total_price_discount_value', 'total_price_discount_start_date', 'total_price_discount_end_date', 'active', 'percent_of_total', 'price', 'no_price_from', 'payment_external', 'title', 'shop_id', 'tax_rate_id', 'mollie_external_payment_way', 'order_confirmed_order_status_id', 'payment_completed_order_status_id', 'payment_failed_order_status_id', 'mollie_api_key', 'modified_by_user_id'];
19 19
 
20 20
     public function getPriceDetails()
21 21
     {
Please login to merge, or discard this patch.
src/Services/Exception/Entity/ExceptionRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
         );
30 30
         
31 31
         if ($id) {
32
-            $rules['name'] =   'required|between:4,65|unique_with:general_setting, shop_id, '.$id.' = id';
32
+            $rules['name'] = 'required|between:4,65|unique_with:general_setting, shop_id, '.$id.' = id';
33 33
         }
34 34
 
35 35
         return $rules;
Please login to merge, or discard this patch.
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/Coupon/CouponService.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 CouponService extends BaseService
11 11
 {
12
-	public function __construct(CouponRepository $coupon)
13
-	{
14
-		$this->repo = $coupon;
15
-	}
12
+    public function __construct(CouponRepository $coupon)
13
+    {
14
+        $this->repo = $coupon;
15
+    }
16 16
 
17 17
 
18 18
     /**
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
         );
32 32
         
33 33
         if ($couponId) {
34
-            $rules['title'] =   'required|between:4,65|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$couponId.' = id';
35
-            $rules['code'] =   'required|between:4,65|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$couponId.' = id';
34
+            $rules['title'] = 'required|between:4,65|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$couponId.' = id';
35
+            $rules['code'] = 'required|between:4,65|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$couponId.' = id';
36 36
         }
37 37
 
38 38
         return $rules;
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         );
47 47
         
48 48
         if ($groupId) {
49
-            $rules['title'] =   'required|between:4,65|unique_with:'.$this->repo->getGroupModel()->getTable().', shop_id, '.$groupId.' = id';
49
+            $rules['title'] = 'required|between:4,65|unique_with:'.$this->repo->getGroupModel()->getTable().', shop_id, '.$groupId.' = id';
50 50
         }
51 51
         
52 52
 
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.