@@ -3,7 +3,7 @@ |
||
| 3 | 3 | namespace BB\Listeners; |
| 4 | 4 | |
| 5 | 5 | use BB\Events\MemberActivity; |
| 6 | -use BB\Repo\ActivityRepository;use Illuminate\Queue\InteractsWithQueue; |
|
| 6 | +use BB\Repo\ActivityRepository; use Illuminate\Queue\InteractsWithQueue; |
|
| 7 | 7 | use Illuminate\Contracts\Queue\ShouldQueue; |
| 8 | 8 | |
| 9 | 9 | class RecordMemberActivity |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function boot(Dispatcher $dispatcher) |
| 15 | 15 | { |
| 16 | - $dispatcher->mapUsing(function($command) |
|
| 16 | + $dispatcher->mapUsing(function ($command) |
|
| 17 | 17 | { |
| 18 | 18 | return Dispatcher::simpleMapping( |
| 19 | 19 | $command, 'BB\Commands', 'BB\Handlers\Commands' |
@@ -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 | }); |
@@ -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(); |
@@ -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 | /** |
@@ -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 | } |
@@ -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() |