@@ -5,40 +5,40 @@ |
||
| 5 | 5 | |
| 6 | 6 | class RouteServiceProvider extends ServiceProvider { |
| 7 | 7 | |
| 8 | - /** |
|
| 9 | - * This namespace is applied to the controller routes in your routes file. |
|
| 10 | - * |
|
| 11 | - * In addition, it is set as the URL generator's root namespace. |
|
| 12 | - * |
|
| 13 | - * @var string |
|
| 14 | - */ |
|
| 15 | - protected $namespace = 'BB\Http\Controllers'; |
|
| 8 | + /** |
|
| 9 | + * This namespace is applied to the controller routes in your routes file. |
|
| 10 | + * |
|
| 11 | + * In addition, it is set as the URL generator's root namespace. |
|
| 12 | + * |
|
| 13 | + * @var string |
|
| 14 | + */ |
|
| 15 | + protected $namespace = 'BB\Http\Controllers'; |
|
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * Define your route model bindings, pattern filters, etc. |
|
| 19 | - * |
|
| 20 | - * @param \Illuminate\Routing\Router $router |
|
| 21 | - * @return void |
|
| 22 | - */ |
|
| 23 | - public function boot(Router $router) |
|
| 24 | - { |
|
| 25 | - // |
|
| 17 | + /** |
|
| 18 | + * Define your route model bindings, pattern filters, etc. |
|
| 19 | + * |
|
| 20 | + * @param \Illuminate\Routing\Router $router |
|
| 21 | + * @return void |
|
| 22 | + */ |
|
| 23 | + public function boot(Router $router) |
|
| 24 | + { |
|
| 25 | + // |
|
| 26 | 26 | |
| 27 | - parent::boot($router); |
|
| 28 | - } |
|
| 27 | + parent::boot($router); |
|
| 28 | + } |
|
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * Define the routes for the application. |
|
| 32 | - * |
|
| 33 | - * @param \Illuminate\Routing\Router $router |
|
| 34 | - * @return void |
|
| 35 | - */ |
|
| 36 | - public function map(Router $router) |
|
| 37 | - { |
|
| 38 | - $router->group(['namespace' => $this->namespace], function($router) |
|
| 39 | - { |
|
| 40 | - require app_path('Http/routes.php'); |
|
| 41 | - }); |
|
| 42 | - } |
|
| 30 | + /** |
|
| 31 | + * Define the routes for the application. |
|
| 32 | + * |
|
| 33 | + * @param \Illuminate\Routing\Router $router |
|
| 34 | + * @return void |
|
| 35 | + */ |
|
| 36 | + public function map(Router $router) |
|
| 37 | + { |
|
| 38 | + $router->group(['namespace' => $this->namespace], function($router) |
|
| 39 | + { |
|
| 40 | + require app_path('Http/routes.php'); |
|
| 41 | + }); |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | 44 | } |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | public function map(Router $router) |
| 37 | 37 | { |
| 38 | - $router->group(['namespace' => $this->namespace], function($router) |
|
| 38 | + $router->group(['namespace' => $this->namespace], function ($router) |
|
| 39 | 39 | { |
| 40 | 40 | require app_path('Http/routes.php'); |
| 41 | 41 | }); |
@@ -3,7 +3,8 @@ discard block |
||
| 3 | 3 | use Illuminate\Routing\Router; |
| 4 | 4 | use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; |
| 5 | 5 | |
| 6 | -class RouteServiceProvider extends ServiceProvider { |
|
| 6 | +class RouteServiceProvider extends ServiceProvider |
|
| 7 | +{ |
|
| 7 | 8 | |
| 8 | 9 | /** |
| 9 | 10 | * This namespace is applied to the controller routes in your routes file. |
@@ -35,8 +36,7 @@ discard block |
||
| 35 | 36 | */ |
| 36 | 37 | public function map(Router $router) |
| 37 | 38 | { |
| 38 | - $router->group(['namespace' => $this->namespace], function($router) |
|
| 39 | - { |
|
| 39 | + $router->group(['namespace' => $this->namespace], function($router) { |
|
| 40 | 40 | require app_path('Http/routes.php'); |
| 41 | 41 | }); |
| 42 | 42 | } |
@@ -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 |