Skip to content

Commit 3b6e2c8

Browse files
committed
fix: patch up type issue (php 7.4)
1 parent 4892810 commit 3b6e2c8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Auth/UsesSubscriptions.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,17 @@ trait UsesSubscriptions
2727
public function subscription(): ?array
2828
{
2929
if (
30-
!$this->subscription && $this->subscription = db()
31-
->select('subscriptions')
32-
->where('user_id', $this->id())
33-
->first() ?? null
30+
!$this->subscription && (
31+
$this->subscription = db()
32+
->select('subscriptions')
33+
->where('user_id', $this->id())
34+
->first()
35+
)
3436
) {
3537
$this->subscription['tier'] = billing()->tier($this->subscription['plan_id']);
3638
}
3739

38-
return $this->subscription;
40+
return $this->subscription ? $this->subscription : null;
3941
}
4042

4143
/**

0 commit comments

Comments
 (0)