Skip to content

Commit 63dffa2

Browse files
arefebshgithub-actions[bot]
authored andcommitted
Fix styling
1 parent d137cd8 commit 63dffa2

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/Token/DatabaseTokenRepository.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@ public function __construct(
1616
protected int $expires,
1717
protected int $tokenLength,
1818
protected string $table
19-
)
20-
{
19+
) {
2120
parent::__construct($expires, $tokenLength);
2221
}
2322

2423
public function deleteExisting(OTPNotifiable $user, string $indicator): bool
2524
{
2625
return (bool)optional($this->getTable()->where([
2726
'mobile' => $user->getMobileForOTPNotification(),
28-
'indicator' => $indicator
27+
'indicator' => $indicator,
2928
]))->delete();
3029
}
3130

@@ -43,7 +42,7 @@ public function exists(string $mobile, string $indicator): bool
4342
{
4443
$record = $this->getLatestRecord(['mobile' => $mobile, 'indicator' => $indicator]);
4544

46-
return $record && !$this->tokenExpired($record['expires_at']);
45+
return $record && ! $this->tokenExpired($record['expires_at']);
4746
}
4847

4948
public function isTokenMatching(OTPNotifiable $user, string $indicator, string $token): bool
@@ -54,7 +53,7 @@ public function isTokenMatching(OTPNotifiable $user, string $indicator, string $
5453
'indicator' => $indicator,
5554
]);
5655

57-
return $record && !$this->tokenExpired($record['expires_at']);
56+
return $record && ! $this->tokenExpired($record['expires_at']);
5857
}
5958

6059
protected function getTable(): Builder

tests/OTPBrokerTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Fouladgar\OTP\Tests\Models\OTPNotifiableUser;
1010
use Illuminate\Support\Facades\Cache;
1111
use Illuminate\Support\Facades\Notification;
12-
use Throwable;
1312

1413
class OTPBrokerTest extends TestCase
1514
{
@@ -76,7 +75,7 @@ public function it_can_send_token_with_using_default_channel(): void
7675

7776
Notification::assertSentTo(
7877
$user,
79-
fn(OTPNotification $notification, $channels) => $channels[0] == config('otp.channel')
78+
fn (OTPNotification $notification, $channels) => $channels[0] == config('otp.channel')
8079
);
8180
}
8281

@@ -93,7 +92,7 @@ public function it_can_send_token_with_using_specified_channels(): void
9392

9493
Notification::assertSentTo(
9594
$user,
96-
fn(OTPNotification $notification, $channels) => $channels == $useChannels
95+
fn (OTPNotification $notification, $channels) => $channels == $useChannels
9796
);
9897
}
9998

@@ -109,7 +108,7 @@ public function it_can_send_token_with_using_extended_channel(): void
109108

110109
Notification::assertSentTo(
111110
$user,
112-
fn(OTPNotification $notification, $channels) => $channels == ['otp_sms']
111+
fn (OTPNotification $notification, $channels) => $channels == ['otp_sms']
113112
);
114113
}
115114

@@ -125,7 +124,7 @@ public function it_can_send_token_with_using_custom_channel(): void
125124

126125
Notification::assertSentTo(
127126
$user,
128-
fn(OTPNotification $notification, $channels) => $channels == [CustomOTPChannel::class]
127+
fn (OTPNotification $notification, $channels) => $channels == [CustomOTPChannel::class]
129128
);
130129
}
131130

@@ -278,7 +277,8 @@ public function it_can_set_multiple_indicators(): void
278277
$this->assertNotEmpty(Cache::get(self::MOBILE));
279278

280279
$user = OTP()->onlyConfirmToken()->indicator($secondIndicator)->validate(
281-
self::MOBILE, Cache::get($secondIndicator . self::MOBILE)['token']
280+
self::MOBILE,
281+
Cache::get($secondIndicator . self::MOBILE)['token']
282282
);
283283

284284
$this->assertInstanceOf(OTPNotifiable::class, $user);

0 commit comments

Comments
 (0)