@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | throw new ModelNotFoundException(); |
| 44 | 44 | } |
| 45 | 45 | $node = $this->model->where('api_key', $apiKey)->first(); |
| 46 | - if (!$node) { |
|
| 46 | + if ( ! $node) { |
|
| 47 | 47 | throw new ModelNotFoundException(); |
| 48 | 48 | } |
| 49 | 49 | return $node; |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | public function logBoot($device) |
| 56 | 56 | { |
| 57 | 57 | $record = $this->model->where('device_id', $device)->first(); |
| 58 | - if (!$record) { |
|
| 58 | + if ( ! $record) { |
|
| 59 | 59 | $record = $this->createRecord($device); |
| 60 | 60 | } |
| 61 | 61 | $record->last_boot = Carbon::now(); |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | { |
| 189 | 189 | $payment = $this->getById($paymentId); |
| 190 | 190 | |
| 191 | - if (!empty($payment->user_id)) { |
|
| 191 | + if ( ! empty($payment->user_id)) { |
|
| 192 | 192 | throw new PaymentException('Payment already assigned to user'); |
| 193 | 193 | } |
| 194 | 194 | |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | */ |
| 267 | 267 | public function getEquipmentFeePayments($referencePrefix) |
| 268 | 268 | { |
| 269 | - return $this->model->where('reason', 'equipment-fee')->get()->filter(function($payment) use($referencePrefix) { |
|
| 269 | + return $this->model->where('reason', 'equipment-fee')->get()->filter(function ($payment) use($referencePrefix) { |
|
| 270 | 270 | return strpos($payment->reference, ':' . $referencePrefix) !== false; |
| 271 | 271 | }); |
| 272 | 272 | } |
@@ -6,34 +6,34 @@ |
||
| 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 | } |
@@ -4,7 +4,8 @@ |
||
| 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. |
@@ -109,7 +109,7 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -210,7 +210,7 @@ |
||
| 210 | 210 | /** |
| 211 | 211 | * Record the fact that the user has agreed to the member induction and the rules |
| 212 | 212 | * |
| 213 | - * @param $userId |
|
| 213 | + * @param integer $userId |
|
| 214 | 214 | */ |
| 215 | 215 | public function recordInductionCompleted($userId) |
| 216 | 216 | { |
@@ -6,7 +6,6 @@ |
||
| 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 | { |
@@ -358,7 +358,7 @@ |
||
| 358 | 358 | |
| 359 | 359 | if ($amount < 5) { |
| 360 | 360 | throw new ValidationException('The minimum subscription is 5 GBP'); |
| 361 | - } elseif (!\Auth::user()->isAdmin() && ($amount < 15)) { |
|
| 361 | + } elseif ( ! \Auth::user()->isAdmin() && ($amount < 15)) { |
|
| 362 | 362 | throw new ValidationException('The minimum subscription is 15 GBP, please contact the trustees for a lower amount. [email protected]'); |
| 363 | 363 | } |
| 364 | 364 | |
@@ -70,7 +70,7 @@ |
||
| 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': |
@@ -12,6 +12,9 @@ discard block |
||
| 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 |
||
| 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 | { |
@@ -1,6 +1,5 @@ |
||
| 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 | |
@@ -1,7 +1,6 @@ |
||
| 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 |
@@ -32,7 +32,7 @@ discard block |
||
| 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 |
||
| 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 | |