Skip to content

Commit d89e53c

Browse files
committed
format
1 parent 9a916a4 commit d89e53c

10 files changed

+22
-22
lines changed

src/HasStripeCustomer.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function shouldCacheStripeCustomer(): bool
2727

2828
public function stripeCustomerCacheKey(): string
2929
{
30-
return get_class($this) . ':' . $this->getKey() . ':' . 'stripe:customer';
30+
return get_class($this).':'.$this->getKey().':'.'stripe:customer';
3131
}
3232

3333
public function cacheStripeCustomer(?array $params = [], $opts = null): static
@@ -47,7 +47,7 @@ public function forgetStripeCustomer(): static
4747
public function createStripeCustomer(?array $params = [], $opts = null): \Stripe\Customer
4848
{
4949
if ($this->stripe_customer_id) {
50-
throw new Exception('[' . get_class($this) . ':' . $this->getKey() . "] Can't create, Stripe customer already exists ({$this->stripe_customer_id})");
50+
throw new Exception('['.get_class($this).':'.$this->getKey()."] Can't create, Stripe customer already exists ({$this->stripe_customer_id})");
5151
}
5252

5353
$customer = $this->stripe()->customers->create([
@@ -73,7 +73,7 @@ public function createStripeCustomer(?array $params = [], $opts = null): \Stripe
7373

7474
public function getStripeCustomer(?array $params = [], $opts = null): ?\Stripe\Customer
7575
{
76-
if (!$this->stripe_customer_id) {
76+
if (! $this->stripe_customer_id) {
7777
return null;
7878
}
7979

@@ -89,7 +89,7 @@ public function getStripeCustomer(?array $params = [], $opts = null): ?\Stripe\C
8989

9090
public function getFreshStripeCustomer(?array $params = [], $opts = null): ?\Stripe\Customer
9191
{
92-
if (!$this->stripe_customer_id) {
92+
if (! $this->stripe_customer_id) {
9393
return null;
9494
}
9595

@@ -101,7 +101,7 @@ public function getFreshStripeCustomer(?array $params = [], $opts = null): ?\Str
101101

102102
public function updateStripeCustomer(?array $params = null, $opts = null): \Stripe\Customer
103103
{
104-
if (!$this->stripe_customer_id) {
104+
if (! $this->stripe_customer_id) {
105105
throw StripeCustomerDoesntExistExecption::make($this, 'update acount');
106106
}
107107

@@ -121,7 +121,7 @@ public function updateStripeCustomer(?array $params = null, $opts = null): \Stri
121121

122122
public function deleteStripeCustomer(?array $params = null, $opts = null): ?\Stripe\Customer
123123
{
124-
if (!$this->stripe_customer_id) {
124+
if (! $this->stripe_customer_id) {
125125
throw StripeCustomerDoesntExistExecption::make($this, 'delete acount');
126126
}
127127

@@ -136,7 +136,7 @@ public function deleteStripeCustomer(?array $params = null, $opts = null): ?\Str
136136

137137
public function checkoutStripeCustomer(?array $params = null, $opts = null): ?\Stripe\Checkout\Session
138138
{
139-
if (!$this->stripe_customer_id) {
139+
if (! $this->stripe_customer_id) {
140140
throw StripeCustomerDoesntExistExecption::make($this, 'checkout');
141141
}
142142

@@ -151,7 +151,7 @@ public function checkoutStripeCustomer(?array $params = null, $opts = null): ?\S
151151

152152
public function createStripeBillingPortalSesssion(array $params = [], $opts = null): \Stripe\BillingPortal\Session
153153
{
154-
if (!$this->stripe_customer_id) {
154+
if (! $this->stripe_customer_id) {
155155
throw StripeCustomerDoesntExistExecption::make($this, 'create billing portal');
156156
}
157157

src/Listeners/AccountApplicationDeauthorized.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function handle(WebhookCall $event): void
2525
{
2626
$model = $this->getModelFromEvent($event);
2727

28-
if (!$model) {
28+
if (! $model) {
2929
return;
3030
}
3131

src/Listeners/AccountUpdated.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ public function handle(WebhookCall $event): void
2626
{
2727
$account = $this->getStripeAccountFromEvent($event);
2828

29-
if (!$account) {
29+
if (! $account) {
3030
return;
3131
}
3232

3333
$model = $this->getModelFromAccount($account);
3434

35-
if (!$model) {
35+
if (! $model) {
3636
return;
3737
}
3838

src/Listeners/CustomerDeleted.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ public function handle(WebhookCall $event): void
2424
{
2525
$customer = $this->getStripeCustomerFromEvent($event);
2626

27-
if (!$customer) {
27+
if (! $customer) {
2828
return;
2929
}
3030

3131
$model = $this->getModelFromCustomer($customer);
3232

33-
if (!$model) {
33+
if (! $model) {
3434
return;
3535
}
3636

src/Listeners/CustomerUpdated.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ public function handle(WebhookCall $event): void
2525
{
2626
$customer = $this->getStripeCustomerFromEvent($event);
2727

28-
if (!$customer) {
28+
if (! $customer) {
2929
return;
3030
}
3131

3232
$model = $this->getModelFromCustomer($customer);
3333

34-
if (!$model) {
34+
if (! $model) {
3535
return;
3636
}
3737

src/ModelRepository.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static function findAccountFromStripeObject(Account $account): ?Model
3232
{
3333
$model = static::findFromStripeObject($account);
3434

35-
if (!$model) {
35+
if (! $model) {
3636
return static::findAccount($account->id);
3737
}
3838

@@ -53,7 +53,7 @@ public static function findCustomerFromStripeObject(Customer $customer): ?Model
5353
{
5454
$model = static::findFromStripeObject($customer);
5555

56-
if (!$model) {
56+
if (! $model) {
5757
return static::findCustomer($customer->id);
5858
}
5959

@@ -75,7 +75,7 @@ protected static function findFromStripeObject(Account|Customer $object): ?Model
7575
$model_type = data_get($object->metadata, 'model_type');
7676
$model_id = data_get($object->metadata, 'model_id');
7777

78-
if (!$model_type || !$model_id) {
78+
if (! $model_type || ! $model_id) {
7979
return null;
8080
}
8181

src/StripeAccountDoesntExistExecption.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ class StripeAccountDoesntExistExecption extends Exception
99
{
1010
public static function make(Model $model, string $action): self
1111
{
12-
return new self('[' . get_class($model) . ':' . $model->getKey() . "] Can't {$action}, Stripe account does not exist");
12+
return new self('['.get_class($model).':'.$model->getKey()."] Can't {$action}, Stripe account does not exist");
1313
}
1414
}

src/StripeCustomerDoesntExistExecption.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ class StripeCustomerDoesntExistExecption extends Exception
99
{
1010
public static function make(Model $model, string $action): self
1111
{
12-
return new self('[' . get_class($model) . ':' . $model->getKey() . "] Can't {$action}, Stripe customer does not exist");
12+
return new self('['.get_class($model).':'.$model->getKey()."] Can't {$action}, Stripe customer does not exist");
1313
}
1414
}

src/Traits/ListenAccountApplicationEvents.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function getModelFromEvent(WebhookCall $event): ?Model
2626
{
2727
$stripeEvent = $this->getStripeEvent($event);
2828

29-
if (!$stripeEvent?->account) {
29+
if (! $stripeEvent?->account) {
3030
return null;
3131
}
3232

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ protected function setUp(): void
1313
parent::setUp();
1414

1515
Factory::guessFactoryNamesUsing(
16-
fn (string $modelName) => 'Elegantly\\Stripe\\Database\\Factories\\' . class_basename($modelName) . 'Factory'
16+
fn (string $modelName) => 'Elegantly\\Stripe\\Database\\Factories\\'.class_basename($modelName).'Factory'
1717
);
1818
}
1919

0 commit comments

Comments
 (0)