@@ -16,10 +16,10 @@ discard block |
||
16 | 16 | */ |
17 | 17 | public function boot() |
18 | 18 | { |
19 | - Blade::directive('time', function ($expression) { |
|
19 | + Blade::directive('time', function($expression) { |
|
20 | 20 | return "<?php echo strftime('%H:%M', date_create($expression)->getTimestamp()); ?>"; |
21 | 21 | }); |
22 | - Blade::directive('datetime', function ($expression) { |
|
22 | + Blade::directive('datetime', function($expression) { |
|
23 | 23 | return "<?php echo strftime('%A, %d.%m.%Y', date_create($expression)->getTimestamp()); ?>"; |
24 | 24 | }); |
25 | 25 | } |
@@ -32,12 +32,12 @@ discard block |
||
32 | 32 | public function register() |
33 | 33 | { |
34 | 34 | $this->app->bind('App\PaymentProvider\Klarna', function() { |
35 | - return new Klarna( config('paymentprovider.sofortConfigKey') ); |
|
35 | + return new Klarna(config('paymentprovider.sofortConfigKey')); |
|
36 | 36 | }); |
37 | 37 | |
38 | 38 | $this->app->bind('App\PaymentProvider\PayPal', function() { |
39 | 39 | return new PayPal( |
40 | - config('paymentprovider.payPalClientId'), // ClientID |
|
40 | + config('paymentprovider.payPalClientId'), // ClientID |
|
41 | 41 | config('paymentprovider.payPalClientSecret') // ClientSecret |
42 | 42 | ); |
43 | 43 | }); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | { |
41 | 41 | $this->sofortApi->setAmount($purchase->total()); |
42 | 42 | $this->sofortApi->setCurrencyCode('EUR'); |
43 | - $this->sofortApi->setReason('#'.$purchase->id . ' Purchase'); |
|
43 | + $this->sofortApi->setReason('#' . $purchase->id . ' Purchase'); |
|
44 | 44 | $this->sofortApi->setSuccessUrl(route('ts.payment.successful', [ |
45 | 45 | 'purchase' => $purchase->random_id, |
46 | 46 | 'secret' => $purchase->payment_secret |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | if ($this->sofortApi->isError()) { |
54 | 54 | // SOFORT-API didn't accept the data |
55 | - foreach($this->sofortApi->getErrors() as $error) { |
|
55 | + foreach ($this->sofortApi->getErrors() as $error) { |
|
56 | 56 | Log::error($error); |
57 | 57 | } |
58 | 58 | throw new PaymentProviderException("SOFORT got errors..."); |
@@ -50,10 +50,10 @@ |
||
50 | 50 | $seatMap->description = $validated['description']; |
51 | 51 | $seatMap->seats = $validated['seats']; |
52 | 52 | |
53 | - if( !empty(json_decode($validated['layout'])) ) |
|
53 | + if (!empty(json_decode($validated['layout']))) |
|
54 | 54 | { |
55 | 55 | $numberOfSeatsInLayout = preg_match_all('/a/', $validated['layout']); |
56 | - if($numberOfSeatsInLayout != $validated['seats']) { |
|
56 | + if ($numberOfSeatsInLayout != $validated['seats']) { |
|
57 | 57 | return redirect() |
58 | 58 | ->route('admin.dependencies.seatmap.get', $seatMap) |
59 | 59 | ->with('status', 'Counted seats of layout (' . $numberOfSeatsInLayout . ') does not match the given seats (' . $validated['seats'] . ')!'); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function passes($attribute, $value) |
37 | 37 | { |
38 | - if($value === NULL || $value === "") { |
|
38 | + if ($value === NULL || $value === "") { |
|
39 | 39 | // it is allowed for the value to be empty |
40 | 40 | return true; |
41 | 41 | } |
@@ -45,20 +45,20 @@ discard block |
||
45 | 45 | |
46 | 46 | // if json_decode result is falsy, then json object could |
47 | 47 | // not be decoded and therefore the input is invalid |
48 | - if(!$rows) { |
|
48 | + if (!$rows) { |
|
49 | 49 | return false; |
50 | 50 | } |
51 | 51 | |
52 | 52 | // iterate over all rows to check that only valid |
53 | 53 | // characters ('a' and '_') have been submitted |
54 | - foreach( $rows as $row ) { |
|
54 | + foreach ($rows as $row) { |
|
55 | 55 | // explanation for regex ^[a_]*$ |
56 | 56 | // ^ = Start of string |
57 | 57 | // [a_] = Only characters "a" and "_" allowed |
58 | 58 | // * = zero or more characters |
59 | 59 | // $ = End of string |
60 | 60 | // Complete: Only match strings that contain from start to end only zero or more characters on the whitelist of a and _ |
61 | - if( !preg_match('/^[a_]*$/', $row) ) { |
|
61 | + if (!preg_match('/^[a_]*$/', $row)) { |
|
62 | 62 | return false; |
63 | 63 | } |
64 | 64 | } |
@@ -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; |
@@ -24,10 +24,10 @@ |
||
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 | 33 | return [ |
@@ -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 | } |