@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | public function getRowAndSeat() |
| 43 | 43 | { |
| 44 | - if( !$this->event->seatMap->layout ) { |
|
| 44 | + if (!$this->event->seatMap->layout) { |
|
| 45 | 45 | return null; |
| 46 | 46 | } |
| 47 | 47 | |
@@ -49,15 +49,15 @@ discard block |
||
| 49 | 49 | $columnCounter = 0; |
| 50 | 50 | $result = []; |
| 51 | 51 | $rows = json_decode($this->event->seatMap->layout); |
| 52 | - foreach( $rows as $rowId => $row ) { |
|
| 52 | + foreach ($rows as $rowId => $row) { |
|
| 53 | 53 | $columnCounter = 0; |
| 54 | - foreach( str_split($row) as $charId => $char) { |
|
| 55 | - if($char === 'a') { |
|
| 54 | + foreach (str_split($row) as $charId => $char) { |
|
| 55 | + if ($char === 'a') { |
|
| 56 | 56 | $counter++; |
| 57 | 57 | $columnCounter++; |
| 58 | 58 | } |
| 59 | - if($counter === $this->seat_number) { |
|
| 60 | - $result['row'] = $rowId+1; |
|
| 59 | + if ($counter === $this->seat_number) { |
|
| 60 | + $result['row'] = $rowId + 1; |
|
| 61 | 61 | $result['seat'] = $columnCounter; |
| 62 | 62 | break; |
| 63 | 63 | } |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | public function getRowsAndColumns() |
| 17 | 17 | { |
| 18 | - if(!$this->layout) { |
|
| 18 | + if (!$this->layout) { |
|
| 19 | 19 | return null; |
| 20 | 20 | } |
| 21 | 21 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | $result['rows'] = count($rows); |
| 26 | 26 | $result['columns'] = array_reduce($rows, function($intermediate, $row) { |
| 27 | 27 | $columns = strlen($row); |
| 28 | - if($intermediate < $columns) { |
|
| 28 | + if ($intermediate < $columns) { |
|
| 29 | 29 | return $columns; |
| 30 | 30 | } else { |
| 31 | 31 | return $intermediate; |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | try { |
| 42 | 42 | DB::statement('show tables'); |
| 43 | 43 | $this->info('Database connection available!'); |
| 44 | - } catch( \Illuminate\Database\QueryException $e) { |
|
| 44 | + } catch (\Illuminate\Database\QueryException $e) { |
|
| 45 | 45 | $this->error('Database connection not available!'); |
| 46 | 46 | exit(1); // return a non-0-code to be used in shell scripts as a falsy exit state |
| 47 | 47 | } |
@@ -17,10 +17,10 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | public function boot() |
| 19 | 19 | { |
| 20 | - Blade::directive('time', function ($expression) { |
|
| 20 | + Blade::directive('time', function($expression) { |
|
| 21 | 21 | return "<?php echo strftime('%H:%M', date_create($expression)->getTimestamp()); ?>"; |
| 22 | 22 | }); |
| 23 | - Blade::directive('datetime', function ($expression) { |
|
| 23 | + Blade::directive('datetime', function($expression) { |
|
| 24 | 24 | return "<?php echo strftime('%A, %d.%m.%Y', date_create($expression)->getTimestamp()); ?>"; |
| 25 | 25 | }); |
| 26 | 26 | } |
@@ -33,18 +33,18 @@ discard block |
||
| 33 | 33 | public function register() |
| 34 | 34 | { |
| 35 | 35 | $this->app->bind('App\PaymentProvider\Klarna', function() { |
| 36 | - return new Klarna( config('paymentprovider.sofortConfigKey') ); |
|
| 36 | + return new Klarna(config('paymentprovider.sofortConfigKey')); |
|
| 37 | 37 | }); |
| 38 | 38 | |
| 39 | 39 | $this->app->bind('App\PaymentProvider\PayPal', function() { |
| 40 | 40 | return new PayPal( |
| 41 | - config('paymentprovider.payPalClientId'), // ClientID |
|
| 41 | + config('paymentprovider.payPalClientId'), // ClientID |
|
| 42 | 42 | config('paymentprovider.payPalClientSecret') // ClientSecret |
| 43 | 43 | ); |
| 44 | 44 | }); |
| 45 | 45 | |
| 46 | 46 | $this->app->bind('App\PaymentProvider\Mollie', function() { |
| 47 | - return new Mollie( config('paymentprovider.mollieApiKey') ); |
|
| 47 | + return new Mollie(config('paymentprovider.mollieApiKey')); |
|
| 48 | 48 | }); |
| 49 | 49 | } |
| 50 | 50 | } |
@@ -68,8 +68,8 @@ discard block |
||
| 68 | 68 | $purchase->payment_id = $payment->id; |
| 69 | 69 | $purchase->save(); |
| 70 | 70 | |
| 71 | - } catch( \Mollie\Api\Exceptions\ApiException $e ) { |
|
| 72 | - throw new PaymentProviderException( $e ); |
|
| 71 | + } catch (\Mollie\Api\Exceptions\ApiException $e) { |
|
| 72 | + throw new PaymentProviderException($e); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | // Set a reference to the customer, depending if a user object exists |
@@ -97,48 +97,48 @@ discard block |
||
| 97 | 97 | $purchaseId = $payment->metadata->purchase_id; |
| 98 | 98 | $purchase = Purchase::find($purchaseId); |
| 99 | 99 | |
| 100 | - if( !$purchase ) { |
|
| 100 | + if (!$purchase) { |
|
| 101 | 101 | throw new PaymentProviderException('Payment-Id "' . $paymentId . '" has no matching purchase!'); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - if( $payment->isPaid() && !$payment->hasRefunds() && !$payment->hasChargebacks() ) { |
|
| 104 | + if ($payment->isPaid() && !$payment->hasRefunds() && !$payment->hasChargebacks()) { |
|
| 105 | 105 | /* |
| 106 | 106 | * The payment is paid and isn't refunded or charged back. |
| 107 | 107 | */ |
| 108 | 108 | // Only send an email with the tickets on the change of state to "paid" |
| 109 | - if($purchase->state != 'paid') { |
|
| 109 | + if ($purchase->state != 'paid') { |
|
| 110 | 110 | Log::info('[Purchase#' . $purchase->id . '] Sending Ticket-Mail.'); |
| 111 | 111 | Mail::to($purchase->customer)->send(new TicketsPaid($purchase)); |
| 112 | 112 | } |
| 113 | - } elseif( $payment->isOpen() ) { |
|
| 113 | + } elseif ($payment->isOpen()) { |
|
| 114 | 114 | /* |
| 115 | 115 | * The payment is open. |
| 116 | 116 | */ |
| 117 | - } elseif( $payment->isPending() ) { |
|
| 117 | + } elseif ($payment->isPending()) { |
|
| 118 | 118 | /* |
| 119 | 119 | * The payment is pending. |
| 120 | 120 | */ |
| 121 | - } elseif( $payment->isFailed() ) { |
|
| 121 | + } elseif ($payment->isFailed()) { |
|
| 122 | 122 | /* |
| 123 | 123 | * The payment has failed. |
| 124 | 124 | */ |
| 125 | 125 | $purchase->deleteWithAllData(); |
| 126 | - } elseif( $payment->isExpired() ) { |
|
| 126 | + } elseif ($payment->isExpired()) { |
|
| 127 | 127 | /* |
| 128 | 128 | * The payment is expired. |
| 129 | 129 | */ |
| 130 | 130 | $purchase->deleteWithAllData(); |
| 131 | - } elseif( $payment->isCanceled() ) { |
|
| 131 | + } elseif ($payment->isCanceled()) { |
|
| 132 | 132 | /* |
| 133 | 133 | * The payment has been canceled. |
| 134 | 134 | */ |
| 135 | 135 | $purchase->deleteWithAllData(); |
| 136 | - } elseif( $payment->hasRefunds() ) { |
|
| 136 | + } elseif ($payment->hasRefunds()) { |
|
| 137 | 137 | /* |
| 138 | 138 | * The payment has been (partially) refunded. |
| 139 | 139 | * The status of the payment is still "paid" |
| 140 | 140 | */ |
| 141 | - } elseif( $payment->hasChargebacks() ) { |
|
| 141 | + } elseif ($payment->hasChargebacks()) { |
|
| 142 | 142 | /* |
| 143 | 143 | * The payment has been (partially) charged back. |
| 144 | 144 | * The status of the payment is still "paid" |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | $purchase->save(); |
| 152 | 152 | |
| 153 | 153 | } catch (\Mollie\Api\Exceptions\ApiException $e) { |
| 154 | - throw new PaymentProviderException( $e ); |
|
| 154 | + throw new PaymentProviderException($e); |
|
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | // Someone could try to cause high load on webservice by |
| 52 | 52 | // requesting the webhook endpoint with fake ids |
| 53 | 53 | $purchase = Purchase::firstWhere('payment_id', $id); |
| 54 | - if( !$purchase ) { |
|
| 54 | + if (!$purchase) { |
|
| 55 | 55 | return response('PaymentId invalid', 403); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | // First check, if the purchase is linked to mollie. |
| 74 | 74 | // Else we would trigger unneccessary api calls |
| 75 | 75 | $mollie = User::firstWhere('email', '[email protected]'); |
| 76 | - if( $purchase->vendor->id !== $mollie->id ) { |
|
| 76 | + if ($purchase->vendor->id !== $mollie->id) { |
|
| 77 | 77 | return response('Not a mollie purchase!', 403); // 403 = Forbidden |
| 78 | 78 | } |
| 79 | 79 | |
@@ -24,13 +24,13 @@ |
||
| 24 | 24 | public function rules() |
| 25 | 25 | { |
| 26 | 26 | $filter = 'in:'; |
| 27 | - if(config('paymentprovider.sofortConfigKey')) { |
|
| 27 | + if (config('paymentprovider.sofortConfigKey')) { |
|
| 28 | 28 | $filter .= 'Klarna,'; |
| 29 | 29 | } |
| 30 | - if(config('paymentprovider.payPalClientSecret')) { |
|
| 30 | + if (config('paymentprovider.payPalClientSecret')) { |
|
| 31 | 31 | $filter .= 'PayPal,'; |
| 32 | 32 | } |
| 33 | - if(config('paymentprovider.mollieApiKey')) { |
|
| 33 | + if (config('paymentprovider.mollieApiKey')) { |
|
| 34 | 34 | $filter .= 'Mollie'; |
| 35 | 35 | } |
| 36 | 36 | return [ |
@@ -41,11 +41,11 @@ |
||
| 41 | 41 | $list->categories()->detach(); |
| 42 | 42 | |
| 43 | 43 | // Only attach categories if submitted (not required) |
| 44 | - if($validated['categories']) { |
|
| 45 | - foreach( $validated['categories'] as $category ) |
|
| 44 | + if ($validated['categories']) { |
|
| 45 | + foreach ($validated['categories'] as $category) |
|
| 46 | 46 | { |
| 47 | 47 | // Attach only the given categories to the list |
| 48 | - $list->categories()->attach( $category['id'], ['priority' => $category['priority']] ); |
|
| 48 | + $list->categories()->attach($category['id'], ['priority' => $category['priority']]); |
|
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
@@ -20,11 +20,11 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | public function events() |
| 22 | 22 | { |
| 23 | - $projects = Project::where('is_archived', 0)->with(['events' => function ($query) { |
|
| 23 | + $projects = Project::where('is_archived', 0)->with(['events' => function($query) { |
|
| 24 | 24 | $query->where('retailer_sell_stop', '>=', new \DateTime())->orderBy('start_date', 'ASC'); |
| 25 | 25 | }, 'events.location'])->get(); |
| 26 | 26 | |
| 27 | - $currentProjects = $projects->filter(function ($project) { |
|
| 27 | + $currentProjects = $projects->filter(function($project) { |
|
| 28 | 28 | return $project->events->count() > 0; |
| 29 | 29 | })->all(); |
| 30 | 30 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function sellTickets(SellTickets $request, Event $event) |
| 51 | 51 | { |
| 52 | - if( new \DateTime($event->retailer_sell_stop) < new \DateTime() ) { |
|
| 52 | + if (new \DateTime($event->retailer_sell_stop) < new \DateTime()) { |
|
| 53 | 53 | Log::warning('Tickets-Sell-Action after retailer_sell_stop by user#' . Auth::user()->id . ' failed'); |
| 54 | 54 | // Redirect user to select a valid amount of tickets |
| 55 | 55 | return redirect()->route('retail.sell.seats', [$event]) |