@@ -162,7 +162,7 @@ |
||
162 | 162 | */ |
163 | 163 | public function onPlan($plan) |
164 | 164 | { |
165 | - return !is_null($this->subscriptions->first(function ($value) use ($plan) { |
|
165 | + return !is_null($this->subscriptions->first(function($value) use ($plan) { |
|
166 | 166 | return $value->plan === $plan && $value->valid(); |
167 | 167 | })); |
168 | 168 | } |
@@ -71,11 +71,11 @@ discard block |
||
71 | 71 | // prepare category event class names like OrderAny |
72 | 72 | $explodedType = explode('.', $event['type']); |
73 | 73 | $category = array_shift($explodedType); |
74 | - $categoryEvent = '\TwentyTwoDigital\CashierFastspring\Events\\' . Str::studly($category) . 'Any'; |
|
74 | + $categoryEvent = '\TwentyTwoDigital\CashierFastspring\Events\\'.Str::studly($category).'Any'; |
|
75 | 75 | |
76 | 76 | // prepare category event class names like activity |
77 | 77 | $activity = str_replace('.', ' ', $event['type']); |
78 | - $activityEvent = '\TwentyTwoDigital\CashierFastspring\Events\\' . Str::studly($activity); |
|
78 | + $activityEvent = '\TwentyTwoDigital\CashierFastspring\Events\\'.Str::studly($activity); |
|
79 | 79 | |
80 | 80 | // there may be some exceptions on events |
81 | 81 | // so if anything goes bad its ID won't be added on the successfullEvents |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | // check if the related event classes are exist |
86 | 86 | // there may be not handled events |
87 | 87 | if (!class_exists($categoryEvent) || !class_exists($activityEvent)) { |
88 | - throw new Exception('There is no event for ' . $event['type']); |
|
88 | + throw new Exception('There is no event for '.$event['type']); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | // trigger events |
@@ -29,20 +29,20 @@ |
||
29 | 29 | |
30 | 30 | // publish migrations |
31 | 31 | $this->publishes([ |
32 | - __DIR__ . '/../resources/migrations/create_subscriptions_table_for_cashier_fastspring.php' => sprintf( |
|
33 | - database_path('migrations') . '/%s_create_subscriptions_table_for_cashier_fastspring.php', |
|
32 | + __DIR__.'/../resources/migrations/create_subscriptions_table_for_cashier_fastspring.php' => sprintf( |
|
33 | + database_path('migrations').'/%s_create_subscriptions_table_for_cashier_fastspring.php', |
|
34 | 34 | date('Y_m_d_His', $time) |
35 | 35 | ), |
36 | - __DIR__ . '/../resources/migrations/upgrade_user_table_for_cashier_fastspring.php' => sprintf( |
|
37 | - database_path('migrations') . '/%s_upgrade_user_table_for_cashier_fastspring.php', |
|
36 | + __DIR__.'/../resources/migrations/upgrade_user_table_for_cashier_fastspring.php' => sprintf( |
|
37 | + database_path('migrations').'/%s_upgrade_user_table_for_cashier_fastspring.php', |
|
38 | 38 | date('Y_m_d_His', ++$time) |
39 | 39 | ), |
40 | - __DIR__ . '/../resources/migrations/create_invoices_table_for_cashier_fastspring.php' => sprintf( |
|
41 | - database_path('migrations') . '/%s_create_invoices_table_for_cashier_fastspring.php', |
|
40 | + __DIR__.'/../resources/migrations/create_invoices_table_for_cashier_fastspring.php' => sprintf( |
|
41 | + database_path('migrations').'/%s_create_invoices_table_for_cashier_fastspring.php', |
|
42 | 42 | date('Y_m_d_His', ++$time) |
43 | 43 | ), |
44 | - __DIR__ . '/../resources/migrations/create_subscription_periods_table_for_cashier_fastspring.php' => sprintf( |
|
45 | - database_path('migrations') . '/%s_create_subscription_periods_table_for_cashier_fastspring.php', |
|
44 | + __DIR__.'/../resources/migrations/create_subscription_periods_table_for_cashier_fastspring.php' => sprintf( |
|
45 | + database_path('migrations').'/%s_create_subscription_periods_table_for_cashier_fastspring.php', |
|
46 | 46 | date('Y_m_d_His', ++$time) |
47 | 47 | ), |
48 | 48 | ]); |
@@ -67,7 +67,7 @@ |
||
67 | 67 | $periodEndDate = $nextDate->subDay()->format('Y-m-d H:i:s'); |
68 | 68 | |
69 | 69 | // yeap, weird way |
70 | - $methodName = 'sub' . Str::title($subscription->interval_unit) . 'sNoOverflow'; |
|
70 | + $methodName = 'sub'.Str::title($subscription->interval_unit).'sNoOverflow'; |
|
71 | 71 | $periodStartDate = $nextDate->$methodName($subscription->interval_length)->addDay()->format('Y-m-d H:i:s'); |
72 | 72 | |
73 | 73 | // fill the model |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | break; |
220 | 220 | |
221 | 221 | default: |
222 | - throw new Exception('Unexcepted interval unit: ' . $subscription->interval_unit); |
|
222 | + throw new Exception('Unexcepted interval unit: '.$subscription->interval_unit); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | $subscriptionPeriodData = [ |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | |
437 | 437 | // else |
438 | 438 | // TODO: it might be better to create custom exception |
439 | - throw new Exception('Swap operation failed. Response: ' . json_encode($response)); |
|
439 | + throw new Exception('Swap operation failed. Response: '.json_encode($response)); |
|
440 | 440 | } |
441 | 441 | |
442 | 442 | /** |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | |
463 | 463 | // else |
464 | 464 | // TODO: it might be better to create custom exception |
465 | - throw new Exception('Cancel operation failed. Response: ' . json_encode($response)); |
|
465 | + throw new Exception('Cancel operation failed. Response: '.json_encode($response)); |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | /** |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | |
487 | 487 | // else |
488 | 488 | // TODO: it might be better to create custom exception |
489 | - throw new Exception('CancelNow operation failed. Response: ' . json_encode($response)); |
|
489 | + throw new Exception('CancelNow operation failed. Response: '.json_encode($response)); |
|
490 | 490 | } |
491 | 491 | |
492 | 492 | /** |
@@ -520,6 +520,6 @@ discard block |
||
520 | 520 | |
521 | 521 | // else |
522 | 522 | // TODO: it might be better to create custom exception |
523 | - throw new Exception('Resume operation failed. Response: ' . json_encode($response)); |
|
523 | + throw new Exception('Resume operation failed. Response: '.json_encode($response)); |
|
524 | 524 | } |
525 | 525 | } |