Passed
Push — master ( 697d1a...ebeb83 )
by Matthijs
06:55
created
src/Services/User/UserService.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 UserService extends BaseService
11 11
 {
12
-	public function __construct(UserRepository $user)
13
-	{
14
-		$this->repo = $user;
15
-	} 
12
+    public function __construct(UserRepository $user)
13
+    {
14
+        $this->repo = $user;
15
+    } 
16 16
 
17 17
     /**
18 18
      * The validation rules for the model.
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
         );
29 29
         
30 30
         if ($userId) {
31
-            $rules['email']     =   $rules['email'].', '.$userId.' = id';
32
-            $rules['username']  =   $rules['email'].', '.$userId.' = id';
31
+            $rules['email']     = $rules['email'].', '.$userId.' = id';
32
+            $rules['username']  = $rules['email'].', '.$userId.' = id';
33 33
         }
34 34
 
35 35
         return $rules;
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         }
47 47
 
48 48
         $model = $this->find($userId);
49
-        $attributes['password']= Hash::make(array_get($attributes, 'password'));
49
+        $attributes['password'] = Hash::make(array_get($attributes, 'password'));
50 50
         return $this->updateOrAddModel($model, $attributes);
51 51
     }
52 52
 
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
         $attributes['password'] = Hash::make(array_get($attributes, 'password'));
72 72
         $attributes['confirmed'] = 0;
73 73
 
74
-        $attributes['confirmation_code']     = md5(uniqid(mt_rand(), true));
74
+        $attributes['confirmation_code'] = md5(uniqid(mt_rand(), true));
75 75
 
76
-        $model =  $this->updateOrAddModel($this->repo->getModel(), $attributes);
76
+        $model = $this->updateOrAddModel($this->repo->getModel(), $attributes);
77 77
 
78 78
         if ($model) {
79 79
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
                     config()->get('confide::email_queue'),
84 84
                     config()->get('confide::email_account_confirmation'),
85 85
                     compact('user'),
86
-                    function ($message) use ($user) {
86
+                    function($message) use ($user) {
87 87
                         $message
88 88
                             ->to($user->email, $user->username)
89 89
                             ->subject(Lang::get('confide::confide.email.account_confirmation.subject'));
@@ -122,9 +122,9 @@  discard block
 block discarded – undo
122 122
         if (count($attributes) > 0) {
123 123
             $this->model->username = array_get($attributes, 'username');
124 124
   
125
-            $this->model->selected_shop_id    = array_get($attributes, 'selected_shop_id');
125
+            $this->model->selected_shop_id = array_get($attributes, 'selected_shop_id');
126 126
             $this->model->email    = array_get($attributes, 'email');
127
-            $this->model->language_id    = array_get($attributes, 'language_id');
127
+            $this->model->language_id = array_get($attributes, 'language_id');
128 128
             $this->model->save();
129 129
 
130 130
             return $this->model;
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
      */
141 141
     public function login($input)
142 142
     {
143
-        if (! isset($input['password'])) {
143
+        if (!isset($input['password'])) {
144 144
             $input['password'] = null;
145 145
         }
146 146
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
                 $user->password
179 179
             );
180 180
 
181
-            return (! $user->confirmed && $correctPassword);
181
+            return (!$user->confirmed && $correctPassword);
182 182
         }
183 183
     }
184 184
 
Please login to merge, or discard this patch.
src/Services/Client/ClientService.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -12,11 +12,11 @@  discard block
 block discarded – undo
12 12
 
13 13
 class ClientService extends BaseService
14 14
 {
15
-	public function __construct(ClientRepository $client, ClientAddressRepository $clientAddress)
16
-	{
17
-		$this->repo = $client;
18
-		$this->repoAddress = $clientAddress;
19
-	} 
15
+    public function __construct(ClientRepository $client, ClientAddressRepository $clientAddress)
16
+    {
17
+        $this->repo = $client;
18
+        $this->repoAddress = $clientAddress;
19
+    } 
20 20
 
21 21
     /**
22 22
      * The validation rules for the model.
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
 
98 98
     public function validateConfirmationCode($confirmationCode, $email, $shopId)
99 99
     {
100
-    	return $this->repo->validateConfirmationCodeByConfirmationCodeAndEmail($confirmationCode, $email, $shopId);
101
-	}
100
+        return $this->repo->validateConfirmationCodeByConfirmationCodeAndEmail($confirmationCode, $email, $shopId);
101
+    }
102 102
 
103 103
     public function validateLogin($attributes) 
104 104
     {
@@ -166,13 +166,13 @@  discard block
 block discarded – undo
166 166
         $client = $this->repo->checkEmailByShopId($attributes['email'], $shopId);
167 167
 
168 168
         if($client AND $client->account_created) {
169
-        	return false;
169
+            return false;
170 170
         }
171 171
 
172 172
         if($client) {
173
-        	$model = $client;
173
+            $model = $client;
174 174
         } else {
175
-        	$model = $this->repo->getModel();
175
+            $model = $this->repo->getModel();
176 176
         }
177 177
 
178 178
         $attributes['shop_id'] = $shopId;
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
     public function createAddress($attributes, $clientId) 
206 206
     {
207 207
         $attributes['client_id'] = $clientId;
208
-  		$model = $this->repoAddress->getModel();
208
+            $model = $this->repoAddress->getModel();
209 209
         $model->fill($attributes);
210 210
         $model->save();
211 211
         
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         }
46 46
 
47 47
         if ($clientId) {
48
-            $rules['email'] =   'required|email|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$clientId.' = id';
48
+            $rules['email'] = 'required|email|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$clientId.' = id';
49 49
         }
50 50
 
51 51
         return $rules;
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
     {
161 161
         // create the validation rules ------------------------
162 162
         $rules = array(
163
-            'email'         => 'required|email',     // required and must be unique in the ducks table
163
+            'email'         => 'required|email', // required and must be unique in the ducks table
164 164
             'password'      => 'required',
165 165
             'firstname'     => 'required',
166 166
             'lastname'      => 'required',
@@ -179,11 +179,11 @@  discard block
 block discarded – undo
179 179
     {
180 180
         $client = $this->repo->checkEmailByShopId($attributes['email'], $shopId);
181 181
 
182
-        if($client AND $client->account_created) {
182
+        if ($client AND $client->account_created) {
183 183
         	return false;
184 184
         }
185 185
 
186
-        if($client) {
186
+        if ($client) {
187 187
         	$model = $client;
188 188
         } else {
189 189
         	$model = $this->repo->getModel();
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
         $attributes['active'] = 0;
195 195
         $attributes['confirmed'] = 0;
196 196
         $attributes['confirmation_code'] = md5(uniqid(mt_rand(), true));      
197
-        if($accountConfirmed) {
197
+        if ($accountConfirmed) {
198 198
             $attributes['active'] = 1;
199 199
             $attributes['confirmed'] = 1;
200 200
             $attributes['confirmation_code'] = null;
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
     {
231 231
         $clientAddress = $this->repoAddress->find($addressId);
232 232
 
233
-        if($clientAddress) {
233
+        if ($clientAddress) {
234 234
             $clientAddress->fill($attributes);
235 235
             $clientAddress->save();
236 236
 
Please login to merge, or discard this patch.
src/Services/Client/Entity/ClientAddressRepository.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
   
19 19
     public function selectAllByClientId($clientId)
20 20
     {
21
-         return $this->model->where('client_id', '=', $clientId)->get();
21
+            return $this->model->where('client_id', '=', $clientId)->get();
22 22
     }
23 23
 
24 24
     public function selectOneByClientIdAndId($clientId, $id)
Please login to merge, or discard this patch.
src/Services/Attribute/AttributeService.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         );
37 37
         
38 38
         if ($id) {
39
-            $rules['title'] =   $rules['title'].','.$id.' = id';
39
+            $rules['title'] = $rules['title'].','.$id.' = id';
40 40
         }
41 41
 
42 42
         return $rules;
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  
10 10
 class AttributeService extends BaseService
11 11
 {
12
-	public function __construct(AttributeRepository $attribute, AttributeGroupRepository $attributeGroup)
13
-	{
14
-		$this->repo = $attribute;
15
-		$this->repoGroup = $attributeGroup;		
16
-	} 
12
+    public function __construct(AttributeRepository $attribute, AttributeGroupRepository $attributeGroup)
13
+    {
14
+        $this->repo = $attribute;
15
+        $this->repoGroup = $attributeGroup;		
16
+    } 
17 17
 
18 18
     /**
19 19
      * laravel validation rules for attribute
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     {
62 62
         $attributes['shop_id'] = auth('hideyobackend')->user()->selected_shop_id;
63 63
         $attributes['modified_by_user_id'] = auth('hideyobackend')->user()->id;
64
-  		$attributes['attribute_group_id'] = $attributeGroupId;
64
+            $attributes['attribute_group_id'] = $attributeGroupId;
65 65
 
66 66
         $validator = Validator::make($attributes, $this->rules());
67 67
 
Please login to merge, or discard this patch.
src/Services/Brand/BrandService.php 2 patches
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.
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
     /**
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         );
41 41
         
42 42
         if ($brandId) {
43
-            $rules['title'] =   $rules['title'].', '.$brandId.' = id';
43
+            $rules['title'] = $rules['title'].', '.$brandId.' = id';
44 44
         }
45 45
      
46 46
         return $rules;
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
         $attributes['extension'] = $attributes['file']->getClientOriginalExtension();
89 89
         $attributes['size'] = $attributes['file']->getSize();
90 90
 
91
-        $filename =  str_replace(" ", "_", strtolower($attributes['file']->getClientOriginalName()));
91
+        $filename = str_replace(" ", "_", strtolower($attributes['file']->getClientOriginalName()));
92 92
         $uploadSuccess = $attributes['file']->move($destinationPath, $filename);
93 93
 
94 94
         if ($uploadSuccess) {
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     {
139 139
         $this->model = $this->find($brandId);
140 140
 
141
-        if($this->model) {
141
+        if ($this->model) {
142 142
             $attributes['modified_by_user_id'] = auth('hideyobackend')->user()->id;
143 143
             $image = $this->findImage($imageId);
144 144
             $image->fill($attributes);
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
     {
201 201
         $result = $this->repo->getModelImage()->get();
202 202
         $shop = ShopService::find($shopId);
203
-        if($result AND $shop->thumbnail_square_sizes) {
203
+        if ($result AND $shop->thumbnail_square_sizes) {
204 204
             foreach ($result as $productImage) {
205 205
                 if ($shop->thumbnail_square_sizes) {
206 206
                     $sizes = explode(',', $shop->thumbnail_square_sizes);
Please login to merge, or discard this patch.
src/Services/Product/ProductAmountSeriesService.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@
 block discarded – undo
10 10
  
11 11
 class ProductAmountSeriesService extends BaseService
12 12
 {
13
-	public function __construct(ProductAmountSeriesRepository $productAmountSeries)
14
-	{
15
-		$this->repo = $productAmountSeries;
16
-	} 
13
+    public function __construct(ProductAmountSeriesRepository $productAmountSeries)
14
+    {
15
+        $this->repo = $productAmountSeries;
16
+    } 
17 17
 
18 18
 
19
- /**
19
+    /**
20 20
      * The validation rules for the model.
21 21
      *
22 22
      * @param  integer  $id id attribute model    
Please login to merge, or discard this patch.
src/database/seeds/ProductTableSeeder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
 
25 25
         $storageImagePath = "/files/product/";
26
-        $publicImagePath = public_path() .config('hideyo.public_path'). "/product/";
26
+        $publicImagePath = public_path().config('hideyo.public_path')."/product/";
27 27
 
28 28
 
29 29
         $productCategory = ProductCategory::where('title', '=', 'Pants')->first();
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         $product2->product_category_id = $productCategory->id;
133 133
         $product2->tax_rate_id = $taxRate->id;
134 134
 
135
-        if (! $product2->save()) {
135
+        if (!$product2->save()) {
136 136
             \Log::info('Unable to create product '.$product2->title, (array)$product2->errors());
137 137
         } else {
138 138
             \Log::info('Created product "'.$product2->title.'" <'.$product2->title.'>');
Please login to merge, or discard this patch.
src/Services/Order/OrderService.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,10 +13,10 @@
 block discarded – undo
13 13
 
14 14
 class OrderService extends BaseService
15 15
 {
16
-	public function __construct(OrderRepository $order)
17
-	{
18
-		$this->repo = $order;
19
-	} 
16
+    public function __construct(OrderRepository $order)
17
+    {
18
+        $this->repo = $order;
19
+    } 
20 20
 
21 21
     public function createAddress(array $attributes, $orderId)
22 22
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
109 109
     {
110 110
         $attributes['shop_id'] = $shopId;
111 111
         $attributes['client_id'] = $attributes['user_id'];
112
-        $client  = ClientService::selectOneByShopIdAndId($shopId, $attributes['user_id']);
112
+        $client = ClientService::selectOneByShopIdAndId($shopId, $attributes['user_id']);
113 113
 
114 114
         $this->repo->getModel()->fill($attributes);
115 115
         $this->repo->getModel()->save();
Please login to merge, or discard this patch.
src/Middleware/DetectShopDomain.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
     {
17 17
         $shop = ShopService::findUrl($request->root());
18 18
 
19
-        if(!$shop) {
19
+        if (!$shop) {
20 20
             abort(404, "shop cannot be found");
21 21
         }
22 22
 
Please login to merge, or discard this patch.