@@ -69,7 +69,7 @@ |
||
| 69 | 69 | * Handle a POST request to reset a user's password. |
| 70 | 70 | * |
| 71 | 71 | * @param Request $request |
| 72 | - * @return \Illuminate\Http\RedirectResponse|null |
|
| 72 | + * @return \Illuminate\Http\RedirectResponse |
|
| 73 | 73 | */ |
| 74 | 74 | public function postReset(Request $request) |
| 75 | 75 | { |
@@ -9,16 +9,16 @@ discard block |
||
| 9 | 9 | class ReminderController extends Controller |
| 10 | 10 | { |
| 11 | 11 | |
| 12 | - /** |
|
| 13 | - * Display the password reminder view. |
|
| 14 | - * |
|
| 15 | - * @return Response |
|
| 16 | - */ |
|
| 17 | - public function create() |
|
| 18 | - { |
|
| 12 | + /** |
|
| 13 | + * Display the password reminder view. |
|
| 14 | + * |
|
| 15 | + * @return Response |
|
| 16 | + */ |
|
| 17 | + public function create() |
|
| 18 | + { |
|
| 19 | 19 | |
| 20 | 20 | return view('password.create'); |
| 21 | - } |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * Handle a POST request to remind a user of their password. |
@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | * @param Request $request |
| 27 | 27 | * @return \Illuminate\Http\RedirectResponse|null |
| 28 | 28 | */ |
| 29 | - public function store(Request $request) |
|
| 30 | - { |
|
| 29 | + public function store(Request $request) |
|
| 30 | + { |
|
| 31 | 31 | $validator = app('Illuminate\Contracts\Validation\Factory')->make($request->all(), ['email' => 'required|email']); |
| 32 | 32 | if ($validator->fails()) { |
| 33 | 33 | throw new FormValidationException('Error', $validator->errors()); |
@@ -39,31 +39,31 @@ discard block |
||
| 39 | 39 | }); |
| 40 | 40 | |
| 41 | 41 | switch ($response) { |
| 42 | - case Password::INVALID_USER: |
|
| 42 | + case Password::INVALID_USER: |
|
| 43 | 43 | \Notification::error(trans($response)); |
| 44 | 44 | return redirect()->back(); |
| 45 | 45 | |
| 46 | - case Password::RESET_LINK_SENT: |
|
| 46 | + case Password::RESET_LINK_SENT: |
|
| 47 | 47 | \Notification::success(trans($response)); |
| 48 | 48 | return redirect()->back(); |
| 49 | - } |
|
| 50 | - } |
|
| 51 | - |
|
| 52 | - /** |
|
| 53 | - * Display the password reset view for the given token. |
|
| 54 | - * |
|
| 55 | - * @param string $token |
|
| 56 | - * @return Response |
|
| 57 | - */ |
|
| 58 | - public function getReset($token = null) |
|
| 59 | - { |
|
| 49 | + } |
|
| 50 | + } |
|
| 51 | + |
|
| 52 | + /** |
|
| 53 | + * Display the password reset view for the given token. |
|
| 54 | + * |
|
| 55 | + * @param string $token |
|
| 56 | + * @return Response |
|
| 57 | + */ |
|
| 58 | + public function getReset($token = null) |
|
| 59 | + { |
|
| 60 | 60 | if (is_null($token)) |
| 61 | 61 | { |
| 62 | 62 | throw new NotFoundHttpException; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | return view('password.reset')->with('token', $token); |
| 66 | - } |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | 68 | /** |
| 69 | 69 | * Handle a POST request to reset a user's password. |
@@ -71,8 +71,8 @@ discard block |
||
| 71 | 71 | * @param Request $request |
| 72 | 72 | * @return \Illuminate\Http\RedirectResponse|null |
| 73 | 73 | */ |
| 74 | - public function postReset(Request $request) |
|
| 75 | - { |
|
| 74 | + public function postReset(Request $request) |
|
| 75 | + { |
|
| 76 | 76 | $credentials = $request->only( |
| 77 | 77 | 'email', 'password', 'password_confirmation', 'token' |
| 78 | 78 | ); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | throw new FormValidationException('Error', $validator->errors()); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - $response = Password::sendResetLink($request->only('email'), function(Message $message) |
|
| 36 | + $response = Password::sendResetLink($request->only('email'), function (Message $message) |
|
| 37 | 37 | { |
| 38 | 38 | $message->subject('Reset your password'); |
| 39 | 39 | }); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | //We aren't using a confirm password box so this can be faked |
| 90 | 90 | $credentials['password_confirmation'] = $credentials['password']; |
| 91 | 91 | |
| 92 | - $response = Password::reset($credentials, function($user, $password) { |
|
| 92 | + $response = Password::reset($credentials, function ($user, $password) { |
|
| 93 | 93 | $user->password = $password; |
| 94 | 94 | |
| 95 | 95 | $user->save(); |
@@ -33,8 +33,7 @@ discard block |
||
| 33 | 33 | throw new FormValidationException('Error', $validator->errors()); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - $response = Password::sendResetLink($request->only('email'), function(Message $message) |
|
| 37 | - { |
|
| 36 | + $response = Password::sendResetLink($request->only('email'), function(Message $message) { |
|
| 38 | 37 | $message->subject('Reset your password'); |
| 39 | 38 | }); |
| 40 | 39 | |
@@ -57,8 +56,7 @@ discard block |
||
| 57 | 56 | */ |
| 58 | 57 | public function getReset($token = null) |
| 59 | 58 | { |
| 60 | - if (is_null($token)) |
|
| 61 | - { |
|
| 59 | + if (is_null($token)) { |
|
| 62 | 60 | throw new NotFoundHttpException; |
| 63 | 61 | } |
| 64 | 62 | |
@@ -5,8 +5,6 @@ |
||
| 5 | 5 | |
| 6 | 6 | use BB\Events\MemberPhotoWasDeclined; |
| 7 | 7 | use Illuminate\Contracts\Mail\Mailer; |
| 8 | -use Illuminate\Queue\InteractsWithQueue; |
|
| 9 | -use Illuminate\Contracts\Queue\ShouldQueue; |
|
| 10 | 8 | |
| 11 | 9 | class EmailMemberAboutDeclinedPhoto |
| 12 | 10 | { |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | * Locate a users active session |
| 63 | 63 | * @param integer $userId |
| 64 | 64 | * @param string $deviceKey |
| 65 | - * @return integer|false |
|
| 65 | + * @return integer |
|
| 66 | 66 | */ |
| 67 | 67 | public function findActiveUserSession($userId, $deviceKey) |
| 68 | 68 | { |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | 78 | * Return an existing active session for the device, if any |
| 79 | - * @param $deviceKey |
|
| 80 | - * @return integer|false |
|
| 79 | + * @param string $deviceKey |
|
| 80 | + * @return integer |
|
| 81 | 81 | */ |
| 82 | 82 | public function findActiveDeviceSession($deviceKey) |
| 83 | 83 | { |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | /** |
| 134 | 134 | * Return records that have been checked over |
| 135 | - * @param $deviceKey |
|
| 135 | + * @param string $deviceKey |
|
| 136 | 136 | * @return mixed |
| 137 | 137 | */ |
| 138 | 138 | public function getFinishedForEquipment($deviceKey) |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | /** |
| 144 | 144 | * @param string $deviceKey |
| 145 | 145 | * @param bool $billedTime |
| 146 | - * @param null $reason |
|
| 146 | + * @param string $reason |
|
| 147 | 147 | * @return int |
| 148 | 148 | */ |
| 149 | 149 | public function getTotalTime($deviceKey, $billedTime = null, $reason = null) |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | use BB\Entities\EquipmentLog; |
| 4 | 4 | use BB\Exceptions\DeviceException; |
| 5 | -use BB\Exceptions\ValidationException; |
|
| 6 | 5 | use Carbon\Carbon; |
| 7 | 6 | |
| 8 | 7 | class EquipmentLogRepository extends DBRepository |
@@ -167,7 +167,7 @@ |
||
| 167 | 167 | } |
| 168 | 168 | }); |
| 169 | 169 | |
| 170 | - return (int) ($totalTime / 60); |
|
| 170 | + return (int)($totalTime / 60); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** |
@@ -33,8 +33,8 @@ |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | - * @param $deviceId |
|
| 37 | - * @return array |
|
| 36 | + * @param string $deviceId |
|
| 37 | + * @return Collection |
|
| 38 | 38 | */ |
| 39 | 39 | public function getTrainersForEquipment($deviceId) |
| 40 | 40 | { |
@@ -195,6 +195,9 @@ |
||
| 195 | 195 | $this->update($paymentId, ['user_id' => $userId]); |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | + /** |
|
| 199 | + * @param integer $paymentId |
|
| 200 | + */ |
|
| 198 | 201 | public function refundPaymentToBalance($paymentId) |
| 199 | 202 | { |
| 200 | 203 | $payment = $this->getById($paymentId); |
@@ -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 | } |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | use BB\Entities\User; |
| 4 | 4 | use BB\Exceptions\InvalidDataException; |
| 5 | -use BB\Exceptions\NotImplementedException; |
|
| 6 | 5 | use BB\Repo\PaymentRepository; |
| 7 | 6 | use BB\Repo\UserRepository; |
| 8 | 7 | |
@@ -43,7 +43,7 @@ |
||
| 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; |
@@ -179,6 +179,9 @@ |
||
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | |
| 182 | + /** |
|
| 183 | + * @return KeyFob |
|
| 184 | + */ |
|
| 182 | 185 | public function lookupKeyFob($keyId) |
| 183 | 186 | { |
| 184 | 187 | try { |
@@ -33,28 +33,28 @@ |
||
| 33 | 33 | { |
| 34 | 34 | |
| 35 | 35 | $schedule->command('bb:calculate-proposal-votes')->hourly() |
| 36 | - ->then( function () { $this->pingIfProduction('http://beats.envoyer.io/heartbeat/U6l211ROnnZR1vI'); } ); |
|
| 36 | + ->then(function () { $this->pingIfProduction('http://beats.envoyer.io/heartbeat/U6l211ROnnZR1vI'); } ); |
|
| 37 | 37 | |
| 38 | 38 | $schedule->command('bb:check-memberships')->dailyAt('06:00') |
| 39 | - ->then( function () { $this->pingIfProduction('http://beats.envoyer.io/heartbeat/76TWKkWBBpaIyOe'); } ); |
|
| 39 | + ->then(function () { $this->pingIfProduction('http://beats.envoyer.io/heartbeat/76TWKkWBBpaIyOe'); } ); |
|
| 40 | 40 | |
| 41 | 41 | $schedule->command('bb:fix-equipment-log')->hourly() |
| 42 | - ->then( function () { $this->pingIfProduction('http://beats.envoyer.io/heartbeat/nxi4SJkwZpIAkBv'); } ); |
|
| 42 | + ->then(function () { $this->pingIfProduction('http://beats.envoyer.io/heartbeat/nxi4SJkwZpIAkBv'); } ); |
|
| 43 | 43 | |
| 44 | 44 | $schedule->command('bb:calculate-equipment-fees')->dailyAt('02:00') |
| 45 | - ->then( function () { $this->pingIfProduction('http://beats.envoyer.io/heartbeat/tFdRdkUoqSa8X66'); } ); |
|
| 45 | + ->then(function () { $this->pingIfProduction('http://beats.envoyer.io/heartbeat/tFdRdkUoqSa8X66'); } ); |
|
| 46 | 46 | |
| 47 | 47 | $schedule->command('bb:update-balances')->dailyAt('03:00') |
| 48 | - ->then( function () { $this->pingIfProduction('http://beats.envoyer.io/heartbeat/TSmoQANsHU9jbtU'); } ); |
|
| 48 | + ->then(function () { $this->pingIfProduction('http://beats.envoyer.io/heartbeat/TSmoQANsHU9jbtU'); } ); |
|
| 49 | 49 | |
| 50 | 50 | $schedule->command('bb:create-todays-sub-charges')->dailyAt('01:00') |
| 51 | - ->then( function () { $this->pingIfProduction('http://beats.envoyer.io/heartbeat/wSIUR1E2wjVBzPg'); } ); |
|
| 51 | + ->then(function () { $this->pingIfProduction('http://beats.envoyer.io/heartbeat/wSIUR1E2wjVBzPg'); } ); |
|
| 52 | 52 | |
| 53 | 53 | $schedule->command('bb:bill-members')->dailyAt('01:30') |
| 54 | - ->then( function () { $this->pingIfProduction('http://beats.envoyer.io/heartbeat/nxAz59P6LXlu2P1'); } ); |
|
| 54 | + ->then(function () { $this->pingIfProduction('http://beats.envoyer.io/heartbeat/nxAz59P6LXlu2P1'); } ); |
|
| 55 | 55 | |
| 56 | 56 | $schedule->command('device:check-online')->everyTenMinutes() |
| 57 | - ->then( function () { $this->pingIfProduction('http://beats.envoyer.io/heartbeat/WU4zql7LwZs1CzT'); } ); |
|
| 57 | + ->then(function () { $this->pingIfProduction('http://beats.envoyer.io/heartbeat/WU4zql7LwZs1CzT'); } ); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | protected function pingIfProduction($url) |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | public function heartbeatWarning() |
| 47 | 47 | { |
| 48 | 48 | //If the last heartbeat was more than an hour ago there is an issue |
| 49 | - if ( $this->monitor_heartbeat && ($this->last_heartbeat < Carbon::now()->subHour())) { |
|
| 49 | + if ($this->monitor_heartbeat && ($this->last_heartbeat < Carbon::now()->subHour())) { |
|
| 50 | 50 | return true; |
| 51 | 51 | } |
| 52 | 52 | |