Completed
Push — proposal-voting-box-users ( 30049d )
by Arthur
02:09
created
app/Services/Registrar.php 2 patches
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -6,34 +6,34 @@
 block discarded – undo
6 6
 
7 7
 class Registrar implements RegistrarContract {
8 8
 
9
-	/**
10
-	 * Get a validator for an incoming registration request.
11
-	 *
12
-	 * @param  array  $data
13
-	 * @return \Illuminate\Contracts\Validation\Validator
14
-	 */
15
-	public function validator(array $data)
16
-	{
17
-		return Validator::make($data, [
18
-			'name' => 'required|max:255',
19
-			'email' => 'required|email|max:255|unique:users',
20
-			'password' => 'required|confirmed|min:6',
21
-		]);
22
-	}
9
+    /**
10
+     * Get a validator for an incoming registration request.
11
+     *
12
+     * @param  array  $data
13
+     * @return \Illuminate\Contracts\Validation\Validator
14
+     */
15
+    public function validator(array $data)
16
+    {
17
+        return Validator::make($data, [
18
+            'name' => 'required|max:255',
19
+            'email' => 'required|email|max:255|unique:users',
20
+            'password' => 'required|confirmed|min:6',
21
+        ]);
22
+    }
23 23
 
24
-	/**
25
-	 * Create a new user instance after a valid registration.
26
-	 *
27
-	 * @param  array  $data
28
-	 * @return User
29
-	 */
30
-	public function create(array $data)
31
-	{
32
-		return User::create([
33
-			'name' => $data['name'],
34
-			'email' => $data['email'],
35
-			'password' => bcrypt($data['password']),
36
-		]);
37
-	}
24
+    /**
25
+     * Create a new user instance after a valid registration.
26
+     *
27
+     * @param  array  $data
28
+     * @return User
29
+     */
30
+    public function create(array $data)
31
+    {
32
+        return User::create([
33
+            'name' => $data['name'],
34
+            'email' => $data['email'],
35
+            'password' => bcrypt($data['password']),
36
+        ]);
37
+    }
38 38
 
39 39
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,8 @@
 block discarded – undo
4 4
 use Validator;
5 5
 use Illuminate\Contracts\Auth\Registrar as RegistrarContract;
6 6
 
7
-class Registrar implements RegistrarContract {
7
+class Registrar implements RegistrarContract
8
+{
8 9
 
9 10
 	/**
10 11
 	 * Get a validator for an incoming registration request.
Please login to merge, or discard this patch.
app/Repo/UserRepository.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
         $memberData['hash'] = str_random(30);
111 111
 
112
-        $memberData['rules_agreed'] = $memberData['rules_agreed']? Carbon::now(): null;
112
+        $memberData['rules_agreed'] = $memberData['rules_agreed'] ? Carbon::now() : null;
113 113
 
114 114
         $user = $this->model->create($memberData);
115 115
         $this->profileDataRepository->createProfile($user->id);
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 
219 219
         $user->induction_completed = true;
220 220
 
221
-        $user->rules_agreed = $user->rules_agreed? $user->rules_agreed: Carbon::now();
221
+        $user->rules_agreed = $user->rules_agreed ? $user->rules_agreed : Carbon::now();
222 222
 
223 223
         $user->save();
224 224
     }
Please login to merge, or discard this patch.
Doc Comments   +12 added lines, -1 removed lines patch added patch discarded remove patch
@@ -196,6 +196,9 @@  discard block
 block discarded – undo
196 196
         $this->subscriptionChargeRepository->cancelOutstandingCharges($userId);
197 197
     }
198 198
 
199
+    /**
200
+     * @param integer $userId
201
+     */
199 202
     public function recordGoCardlessMandateDetails($userId, $subscriptionId)
200 203
     {
201 204
         /** @var User $user */
@@ -205,6 +208,11 @@  discard block
 block discarded – undo
205 208
         $user->save();
206 209
     }
207 210
 
211
+    /**
212
+     * @param integer $userId
213
+     * @param string $paymentMethod
214
+     * @param integer $paymentDay
215
+     */
208 216
     public function updateUserPaymentMethod($userId, $paymentMethod, $paymentDay = null)
209 217
     {
210 218
         /** @var User $user */
@@ -216,6 +224,9 @@  discard block
 block discarded – undo
216 224
         $user->save();
217 225
     }
218 226
 
227
+    /**
228
+     * @param integer $userId
229
+     */
219 230
     public function recordGoCardlessSubscription($userId, $subscriptionId, $paymentDay = null)
220 231
     {
221 232
         /** @var User $user */
@@ -230,7 +241,7 @@  discard block
 block discarded – undo
230 241
     /**
231 242
      * Record the fact that the user has agreed to the member induction and the rules
232 243
      *
233
-     * @param $userId
244
+     * @param integer $userId
234 245
      */
235 246
     public function recordInductionCompleted($userId)
236 247
     {
Please login to merge, or discard this patch.
app/Http/Controllers/AccountController.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
6 6
 use BB\Events\MemberGivenTrustedStatus;
7 7
 use BB\Events\MemberPhotoWasDeclined;
8 8
 use BB\Exceptions\ValidationException;
9
-use BB\Validators\InductionValidator;
10 9
 
11 10
 class AccountController extends Controller
12 11
 {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -324,12 +324,12 @@  discard block
 block discarded – undo
324 324
         if (\Input::has('experimental_dd_subscription')) {
325 325
             $subscription = $this->goCardless->createSubscription($user->mandate_id, $user->monthly_subscription * 100, $user->payment_day, 'NEW-BBSUB' . $user->id);
326 326
 
327
-            $this->userRepository->recordGoCardlessSubscription($user->id,  $subscription->id);
327
+            $this->userRepository->recordGoCardlessSubscription($user->id, $subscription->id);
328 328
         }
329 329
         if (\Input::has('cancel_experimental_dd_subscription')) {
330 330
             $this->goCardless->cancelSubscription($user->subscription_id);
331 331
 
332
-            $this->userRepository->recordGoCardlessSubscription($user->id,  null);
332
+            $this->userRepository->recordGoCardlessSubscription($user->id, null);
333 333
         }
334 334
 
335 335
 
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 
414 414
         if ($amount < 5) {
415 415
             throw new ValidationException('The minimum subscription is 5 GBP');
416
-        } elseif (!\Auth::user()->isAdmin() && ($amount < 20)) {
416
+        } elseif ( ! \Auth::user()->isAdmin() && ($amount < 20)) {
417 417
             throw new ValidationException('The minimum subscription is 20 GBP, please contact the trustees for a lower amount. [email protected]');
418 418
         }
419 419
 
Please login to merge, or discard this patch.
app/Presenters/PaymentPresenter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
             case 'manual':
71 71
                 return 'Manual';
72 72
             case 'cash':
73
-                return 'Cash' . ($this->entity->source_id? ' (' . $this->entity->source_id . ')':'');
73
+                return 'Cash' . ($this->entity->source_id ? ' (' . $this->entity->source_id . ')' : '');
74 74
             case 'other':
75 75
                 return 'Other';
76 76
             case 'balance':
Please login to merge, or discard this patch.
app/Helpers/UserImage.php 2 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,6 +12,9 @@  discard block
 block discarded – undo
12 12
 
13 13
     }
14 14
 
15
+    /**
16
+     * @param string $userId
17
+     */
15 18
     public function uploadPhoto($userId, $filePath, $newImage = false)
16 19
     {
17 20
         $tmpFilePath = storage_path('app') . '/' . $userId . '.png';
@@ -46,7 +49,7 @@  discard block
 block discarded – undo
46 49
 
47 50
     /**
48 51
      * Delete an old profile image and replace it with a new one.
49
-     * @param $userId
52
+     * @param string $userId
50 53
      */
51 54
     public function approveNewImage($userId)
52 55
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,5 @@
 block discarded – undo
1 1
 <?php namespace BB\Helpers;
2 2
 
3
-use BB\Exceptions\UserImageFailedException;
4 3
 use Illuminate\Support\Facades\Storage;
5 4
 use Intervention\Image\Facades\Image;
6 5
 
Please login to merge, or discard this patch.
app/Http/Controllers/InductionController.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@
 block discarded – undo
1 1
 <?php namespace BB\Http\Controllers;
2 2
 
3 3
 use BB\Entities\Induction;
4
-use BB\Exceptions\PaymentException;
5 4
 use BB\Repo\PaymentRepository;
6 5
 
7 6
 class InductionController extends Controller
Please login to merge, or discard this patch.
app/Http/Controllers/MembersController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
     public function index()
34 34
     {
35
-        $users = $this->userRepository->getActivePublicList(!\Auth::guest());
35
+        $users = $this->userRepository->getActivePublicList( ! \Auth::guest());
36 36
         return \View::make('members.index')->withUsers($users);
37 37
     }
38 38
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             return \Response::make('', 404);
45 45
         }
46 46
 
47
-        if (!$user->active) {
47
+        if ( ! $user->active) {
48 48
             return \Response::make('', 404);
49 49
         }
50 50
 
Please login to merge, or discard this patch.
app/Repo/InductionRepository.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
     }
34 34
 
35 35
     /**
36
-     * @param $deviceId
36
+     * @param string $deviceId
37 37
      * @return array
38 38
      */
39 39
     public function getTrainersForEquipment($deviceId)
Please login to merge, or discard this patch.
app/Entities/Settings.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -39,6 +39,9 @@
 block discarded – undo
39 39
         self::create(['key' => $key, 'value' => $value]);
40 40
     }
41 41
 
42
+    /**
43
+     * @param string $key
44
+     */
42 45
     public static function get($key)
43 46
     {
44 47
         $setting = self::findOrFail($key);
Please login to merge, or discard this patch.