Skip to content

Commit 36d7248

Browse files
committed
WIP
1 parent 41f80d8 commit 36d7248

8 files changed

+17
-25
lines changed

src/DTO/Carrier.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ public function __construct(
2323
public string $mobile_country_code,
2424
public string $mobile_network_code,
2525
public string $type,
26-
) {
27-
}
26+
) {}
2827

2928
public static function fake(
3029
?string $error_code = null,

src/DTO/Lookup.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ public static function fromJson(array $lookup): ?self
1717
);
1818
}
1919

20-
public function __construct(public Carrier $carrier)
21-
{
22-
}
20+
public function __construct(public Carrier $carrier) {}
2321

2422
public static function fake(?Carrier $carrier = null): self
2523
{

src/DTO/SendCodeAttempt.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ public function __construct(
2424
public Carbon $time,
2525
public string $channel,
2626
public string $attempt_sid,
27-
) {
28-
}
27+
) {}
2928

3029
public static function fake(
3130
?Carbon $time = null,
@@ -35,7 +34,7 @@ public static function fake(
3534
return new static(
3635
time: $time ?? now(),
3736
channel: $channel ?? 'sms',
38-
attempt_sid: $attempt_sid ?? 'VL' . Str::random(32),
37+
attempt_sid: $attempt_sid ?? 'VL'.Str::random(32),
3938
);
4039
}
4140
}

src/DTO/VerificationCheck.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ public function __construct(
3333
public bool $valid,
3434
public Carbon $created_at,
3535
public Carbon $updated_at,
36-
) {
37-
}
36+
) {}
3837

3938
public static function fake(
4039
?string $sid = null,
@@ -48,9 +47,9 @@ public static function fake(
4847
?string $updated_at = null,
4948
): self {
5049
return new static(
51-
sid: $sid ?? 'VE' . Str::random(32),
52-
service_sid: $service_sid ?? 'VA' . Str::random(32),
53-
account_sid: $account_sid ?? 'AC' . Str::random(32),
50+
sid: $sid ?? 'VE'.Str::random(32),
51+
service_sid: $service_sid ?? 'VA'.Str::random(32),
52+
account_sid: $account_sid ?? 'AC'.Str::random(32),
5453
to: $to ?? '+41795555825',
5554
channel: $channel ?? 'sms',
5655
status: $status ?? 'approved',

src/DTO/VerificationStart.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ public function __construct(
4343
public ?Lookup $lookup,
4444
public Collection $send_code_attempts,
4545
public string $url,
46-
) {
47-
}
46+
) {}
4847

4948
public static function fake(
5049
?string $sid = null,
@@ -60,12 +59,12 @@ public static function fake(
6059
?Collection $send_code_attempts = null,
6160
?string $url = null,
6261
): self {
63-
$service = 'VA' . Str::random(32);
62+
$service = 'VA'.Str::random(32);
6463

6564
return new static(
66-
sid: $sid ?? 'VE' . Str::random(32),
65+
sid: $sid ?? 'VE'.Str::random(32),
6766
service_sid: $service_sid ?? $service,
68-
account_sid: $account_sid ?? 'AC' . Str::random(32),
67+
account_sid: $account_sid ?? 'AC'.Str::random(32),
6968
to: $to ?? '+41795555825',
7069
channel: $channel ?? 'sms',
7170
status: $status ?? 'pending',

src/Events/TwilioVerifyResponseLog.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,5 @@ class TwilioVerifyResponseLog
1313
use InteractsWithSockets;
1414
use SerializesModels;
1515

16-
public function __construct(public Response $response)
17-
{
18-
}
16+
public function __construct(public Response $response) {}
1917
}

tests/Feature/TwilioVerifyTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function it_does_start_a_verification_with_sms()
1818
Event::fake();
1919
$phoneNumber = '+12085059915';
2020

21-
$verification = (new TwilioVerify())->start(to: $phoneNumber);
21+
$verification = (new TwilioVerify)->start(to: $phoneNumber);
2222

2323
$this->assertInstanceOf(VerificationStart::class, $verification);
2424
$this->assertSame($phoneNumber, $verification->to);
@@ -37,7 +37,7 @@ public function it_does_check_a_verification_with_sms()
3737
$code = '4804';
3838
$phoneNumber = '+12085059915';
3939

40-
$verification = (new TwilioVerify())->check(
40+
$verification = (new TwilioVerify)->check(
4141
to: $phoneNumber,
4242
code: $code,
4343
);

tests/TestCase.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
class TestCase extends Orchestra
1010
{
11-
public function setUp(): void
11+
protected function setUp(): void
1212
{
1313
parent::setUp();
1414

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

0 commit comments

Comments
 (0)