@@ -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 | } |
@@ -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': |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | public function recalculate() |
45 | 45 | { |
46 | - if (! $this->user instanceof User) { |
|
46 | + if ( ! $this->user instanceof User) { |
|
47 | 47 | throw new InvalidDataException("User not set"); |
48 | 48 | } |
49 | 49 | $runningTotal = 0; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | public function getBalanceSign() |
98 | 98 | { |
99 | - return ( (int) $this->getBalance() >= 0 ? 'positive' : 'negative' ); |
|
99 | + return ((int)$this->getBalance() >= 0 ? 'positive' : 'negative'); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | public function getBalanceFormatted() |
@@ -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 |
@@ -5,19 +5,19 @@ |
||
5 | 5 | class SettingsController extends Controller |
6 | 6 | { |
7 | 7 | |
8 | - /** |
|
9 | - * Store a newly created resource in storage. |
|
10 | - * |
|
11 | - * @return \Illuminate\Http\RedirectResponse |
|
12 | - */ |
|
13 | - public function update() |
|
14 | - { |
|
8 | + /** |
|
9 | + * Store a newly created resource in storage. |
|
10 | + * |
|
11 | + * @return \Illuminate\Http\RedirectResponse |
|
12 | + */ |
|
13 | + public function update() |
|
14 | + { |
|
15 | 15 | $input = \Input::only('key', 'value'); |
16 | 16 | |
17 | 17 | Settings::change($input['key'], $input['value']); |
18 | 18 | |
19 | 19 | \Notification::success("Setting updated"); |
20 | 20 | return redirect()->back()->withInput(); |
21 | - } |
|
21 | + } |
|
22 | 22 | |
23 | 23 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function handle($request, Closure $next) |
15 | 15 | { |
16 | - if( ! $request->isSecure() && env('FORCE_SECURE', 'true')) { |
|
16 | + if ( ! $request->isSecure() && env('FORCE_SECURE', 'true')) { |
|
17 | 17 | if ((strpos($request->path(), 'access-control/') !== 0) && ($request->path() !== 'acs') && ($request->path() !== 'acs/spark')) { |
18 | 18 | return redirect()->secure($request->path()); |
19 | 19 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | Route::post('account/{account}/payment', ['uses' => 'PaymentController@store', 'as' => 'account.payment.store', 'middleware' => 'role:admin']); |
74 | 74 | |
75 | -Route::group(array('middleware' => 'role:finance'), function() { |
|
75 | +Route::group(array('middleware' => 'role:finance'), function () { |
|
76 | 76 | Route::resource('payments', 'PaymentController', ['only' => ['index', 'destroy', 'update']]); |
77 | 77 | Route::get('payments/overview', ['uses'=>'PaymentOverviewController@index', 'as'=>'payments.overview']); |
78 | 78 | Route::get('payments/sub-charges', ['as' => 'payments.sub-charges', 'uses' => 'SubscriptionController@listCharges']); |
@@ -92,13 +92,13 @@ discard block |
||
92 | 92 | |
93 | 93 | |
94 | 94 | //Cash |
95 | -Route::group(array('middleware' => 'role:admin'), function() { |
|
95 | +Route::group(array('middleware' => 'role:admin'), function () { |
|
96 | 96 | Route::post('account/{account}/payment/cash/create', ['as'=>'account.payment.cash.create', 'uses' => 'CashPaymentController@store']); |
97 | 97 | Route::delete('account/{account}/payment/cash', ['as'=>'account.payment.cash.destroy', 'uses' => 'CashPaymentController@destroy']); |
98 | 98 | }); |
99 | 99 | |
100 | 100 | # Statements |
101 | -Route::group(array('middleware' => 'role:finance'), function() { |
|
101 | +Route::group(array('middleware' => 'role:finance'), function () { |
|
102 | 102 | Route::resource('statement-import', 'StatementImportController', ['except' => ['index', 'show', 'edit', 'update', 'destroy']]); |
103 | 103 | }); |
104 | 104 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | # Inductions |
112 | 112 | ########################## |
113 | 113 | |
114 | -Route::group(array('middleware' => 'role:admin'), function() { |
|
114 | +Route::group(array('middleware' => 'role:admin'), function () { |
|
115 | 115 | Route::post('equipment_training/update', ['uses'=>'InductionController@update', 'as'=>'equipment_training.update']); |
116 | 116 | Route::resource('account.induction', 'InductionController', ['only' => ['update', 'destroy']]); |
117 | 117 | }); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | # Equipment |
123 | 123 | ########################## |
124 | 124 | |
125 | -Route::group(array('middleware' => 'role:member'), function() { |
|
125 | +Route::group(array('middleware' => 'role:member'), function () { |
|
126 | 126 | Route::resource('equipment', 'EquipmentController'); |
127 | 127 | Route::post('equipment/{id}/photo', ['uses'=>'EquipmentController@addPhoto', 'as'=>'equipment.photo.store']); |
128 | 128 | Route::delete('equipment/{id}/photo/{key}', ['uses'=>'EquipmentController@destroyPhoto', 'as'=>'equipment.photo.destroy']); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | # Key fobs |
146 | 146 | ########################## |
147 | 147 | |
148 | -Route::group(array('middleware' => 'role:admin'), function() { |
|
148 | +Route::group(array('middleware' => 'role:admin'), function () { |
|
149 | 149 | Route::resource('keyfob', 'KeyFobController', ['only' => ['index', 'store', 'update', 'destroy']]); |
150 | 150 | }); |
151 | 151 | |
@@ -178,11 +178,11 @@ discard block |
||
178 | 178 | Route::post('camera/event/store', ['uses' => 'CCTVController@store']); |
179 | 179 | Route::post('camera/store', ['uses' => 'CCTVController@storeSingle']); |
180 | 180 | |
181 | -Route::group(array('middleware' => 'role:admin'), function() { |
|
181 | +Route::group(array('middleware' => 'role:admin'), function () { |
|
182 | 182 | Route::resource('detected_devices', 'DetectedDevicesController'); |
183 | 183 | }); |
184 | 184 | |
185 | -Route::group(array('middleware' => 'role:acs'), function() { |
|
185 | +Route::group(array('middleware' => 'role:acs'), function () { |
|
186 | 186 | Route::resource('devices', 'DeviceController'); |
187 | 187 | }); |
188 | 188 | |
@@ -259,11 +259,11 @@ discard block |
||
259 | 259 | # Roles |
260 | 260 | ########################## |
261 | 261 | |
262 | -Route::group(array('middleware' => 'role:admin'), function() { |
|
262 | +Route::group(array('middleware' => 'role:admin'), function () { |
|
263 | 263 | Route::resource('roles', 'RolesController', []); |
264 | 264 | Route::resource('roles.users', 'RoleUsersController', ['only' => ['destroy', 'store']]); |
265 | 265 | }); |
266 | -Route::group(array('middleware' => 'role:member'), function() { |
|
266 | +Route::group(array('middleware' => 'role:member'), function () { |
|
267 | 267 | Route::resource('groups', 'GroupsController', ['only' => ['index', 'show']]); |
268 | 268 | }); |
269 | 269 | |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | # Expenses |
283 | 283 | ########################## |
284 | 284 | |
285 | -Route::group(array('middleware' => 'role:member'), function() { |
|
285 | +Route::group(array('middleware' => 'role:member'), function () { |
|
286 | 286 | Route::resource('expenses', 'ExpensesController'); |
287 | 287 | }); |
288 | 288 | |
@@ -305,10 +305,10 @@ discard block |
||
305 | 305 | |
306 | 306 | |
307 | 307 | |
308 | -Route::any('api-docs.json', function() { |
|
308 | +Route::any('api-docs.json', function () { |
|
309 | 309 | $filePath = Config::get('swagger.doc-dir') . "/api-docs.json"; |
310 | 310 | |
311 | - if (!File::Exists($filePath)) { |
|
311 | + if ( ! File::Exists($filePath)) { |
|
312 | 312 | App::abort(404, "Cannot find {$filePath}"); |
313 | 313 | } |
314 | 314 | |
@@ -318,13 +318,13 @@ discard block |
||
318 | 318 | )); |
319 | 319 | }); |
320 | 320 | |
321 | -Route::get('api-docs', function() { |
|
321 | +Route::get('api-docs', function () { |
|
322 | 322 | if (Config::get('swagger.generateAlways')) { |
323 | - $appDir = base_path()."/".Config::get('swagger.app-dir'); |
|
323 | + $appDir = base_path() . "/" . Config::get('swagger.app-dir'); |
|
324 | 324 | $docDir = Config::get('swagger.doc-dir'); |
325 | 325 | |
326 | 326 | |
327 | - if (!File::exists($docDir) || is_writable($docDir)) { |
|
327 | + if ( ! File::exists($docDir) || is_writable($docDir)) { |
|
328 | 328 | // delete all existing documentation |
329 | 329 | if (File::exists($docDir)) { |
330 | 330 | File::deleteDirectory($docDir); |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | |
335 | 335 | $excludeDirs = Config::get('swagger.excludes'); |
336 | 336 | |
337 | - $swagger = \Swagger\scan($appDir, [ |
|
337 | + $swagger = \Swagger\scan($appDir, [ |
|
338 | 338 | 'exclude' => $excludeDirs |
339 | 339 | ]); |
340 | 340 |