Skip to content

Commit d146079

Browse files
committed
Misc. updates
1 parent 119ae8d commit d146079

File tree

11 files changed

+28
-43
lines changed

11 files changed

+28
-43
lines changed

.github/workflows/run-tests.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ jobs:
99
strategy:
1010
fail-fast: true
1111
matrix:
12-
php: ['8.1', '8.2', '8.3']
13-
laravel: ['10.*', '11.*']
12+
php: ['8.1', '8.2', '8.3', '8.4']
13+
laravel: ['10.*', '11.*', '12.*']
1414
composer-flags: ['--prefer-stable']
1515
can-fail: [false]
1616
include:
@@ -21,18 +21,14 @@ jobs:
2121
exclude:
2222
- php: '8.1'
2323
laravel: '11.*'
24+
- php: '8.1'
25+
laravel: '12.*'
2426

2527
name: "PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}${{ matrix.composer-flags != '' && format(' - Composer {0}', matrix.composer-flags) || '' }}"
2628

2729
steps:
2830
- name: Checkout code
29-
uses: actions/checkout@v3
30-
31-
- name: Cache dependencies
32-
uses: actions/cache@v3
33-
with:
34-
path: ~/.composer/cache/files
35-
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}-flags-${{ matrix.composer-flags }}
31+
uses: actions/checkout@v4
3632

3733
- name: Setup PHP
3834
uses: shivammathur/setup-php@v2

.php-cs-fixer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
'@PHP81Migration' => true,
1616
'@PHP80Migration:risky' => true,
1717
'@PHPUnit100Migration:risky' => true,
18-
'@PSR12' => true,
19-
'@PSR2' => true,
18+
'@PER-CS' => true,
19+
'@PER-CS:risky' => true,
2020
'align_multiline_comment' => true,
2121
'array_indentation' => true,
2222
'array_syntax' => [

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
"keywords": ["laravel", "twilio"],
66
"require": {
77
"php": "^8.1",
8-
"illuminate/http": "^10.0 || ^11.0",
9-
"illuminate/support": "^10.0 || ^11.0",
8+
"illuminate/http": "^10.0 || ^11.0 || ^12.0",
9+
"illuminate/support": "^10.0 || ^11.0 || ^12.0",
1010
"twilio/sdk": "^6.44 || ^7.0 || ^8.0"
1111
},
1212
"require-dev": {
1313
"guzzlehttp/guzzle": "^7.5",
14-
"laravel/framework": "^10.0 || ^11.0",
15-
"orchestra/testbench": "^8.0 || ^9.0",
16-
"phpunit/phpunit": "^10.0 || ^11.0"
14+
"laravel/framework": "^10.0 || ^11.0 || ^12.0",
15+
"orchestra/testbench": "^8.0 || ^9.0 || ^10.0",
16+
"phpunit/phpunit": "^10.5 || ^11.5"
1717
},
1818
"suggest": {
1919
"illuminate/notifications": "To use Laravel's notifications component with this package"

src/Notifications/Channels/TwilioChannel.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ final class TwilioChannel
1111
{
1212
public function __construct(
1313
private readonly TwilioClient $twilio,
14-
) {
15-
}
14+
) {}
1615

1716
/**
1817
* @throws TwilioException on Twilio API failure

src/Providers/TwilioProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ private function registerConnectionManager(): void
5252
{
5353
$this->app->singleton(
5454
ConnectionManager::class,
55-
static fn (Application $app): ConnectionManager => new ConnectionManager($app),
55+
static fn(Application $app): ConnectionManager => new ConnectionManager($app),
5656
);
5757

5858
$this->app->alias(ConnectionManager::class, TwilioClient::class);

src/Twilio/Http/LaravelHttpClient.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ final class LaravelHttpClient implements Client
1111
{
1212
public function __construct(
1313
private readonly Factory $httpFactory,
14-
) {
15-
}
14+
) {}
1615

1716
/**
1817
* @throws HttpException if the request cannot be completed

src/TwilioClient.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ final class TwilioClient implements TwilioClientContract
1616
public function __construct(
1717
private readonly Client $twilio,
1818
private readonly string $from,
19-
) {
20-
}
19+
) {}
2120

2221
public function twilio(): Client
2322
{

tests/ConnectionManagerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function testRetrievingTheSdkClientProxiesThrough(): void
6060
$manager = $this->app->make(ConnectionManager::class);
6161
$manager->extend(
6262
'twilio',
63-
static fn (Container $container): TwilioClientContract => $client
63+
static fn(Container $container): TwilioClientContract => $client
6464
);
6565

6666
$this->assertSame($twilioClient, $manager->twilio());
@@ -81,7 +81,7 @@ public function testPlacingACallProxiesThrough(): void
8181
$manager = $this->app->make(ConnectionManager::class);
8282
$manager->extend(
8383
'twilio',
84-
static fn (Container $container): TwilioClientContract => $client
84+
static fn(Container $container): TwilioClientContract => $client
8585
);
8686

8787
$this->assertSame($call, $manager->call('me', []));
@@ -103,7 +103,7 @@ public function testSendingAMessageProxiesThrough(): void
103103

104104
$manager->extend(
105105
'twilio',
106-
static fn (Container $container): TwilioClientContract => $client
106+
static fn(Container $container): TwilioClientContract => $client
107107
);
108108

109109
$this->assertSame($message, $manager->message('me', 'Hello!', []));

tests/Facades/TwilioClientTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function testRetrievingTheSdkClientProxiesThrough(): void
5858
$manager = $this->app->make(ConnectionManager::class);
5959
$manager->extend(
6060
'twilio',
61-
static fn (Container $container): TwilioClientContract => $client
61+
static fn(Container $container): TwilioClientContract => $client
6262
);
6363

6464
$this->assertSame($twilioClient, \TwilioClient::twilio());
@@ -79,7 +79,7 @@ public function testPlacingACallProxiesThrough(): void
7979
$manager = $this->app->make(ConnectionManager::class);
8080
$manager->extend(
8181
'twilio',
82-
static fn (Container $container): TwilioClientContract => $client
82+
static fn(Container $container): TwilioClientContract => $client
8383
);
8484

8585
$this->assertSame($call, \TwilioClient::call('me', []));
@@ -101,7 +101,7 @@ public function testSendingAMessageProxiesThrough(): void
101101

102102
$manager->extend(
103103
'twilio',
104-
static fn (Container $container): TwilioClientContract => $client
104+
static fn(Container $container): TwilioClientContract => $client
105105
);
106106

107107
$this->assertSame($message, \TwilioClient::message('me', 'Hello!', []));

tests/Notifications/Channels/TwilioChannelTest.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ public function via(mixed $notifiable): array
5959
return ['twilio'];
6060
}
6161

62-
public function routeNotificationForTwilio(Notification $notification): void
63-
{
64-
}
62+
public function routeNotificationForTwilio(Notification $notification): void {}
6563
};
6664

6765
$notification = new class() extends Notification {
@@ -96,9 +94,7 @@ public function routeNotificationForTwilio(Notification $notification): string
9694
};
9795

9896
$notification = new class() extends Notification {
99-
public function toTwilio(mixed $notifiable): void
100-
{
101-
}
97+
public function toTwilio(mixed $notifiable): void {}
10298
};
10399

104100
$this->assertNull((new TwilioChannel($twilio))->send($notifiable, $notification));

tests/Twilio/Http/LaravelHttpClientTest.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,9 @@ public function testARequestCanBeSentToTheTwilioApiWithoutCredentials(): void
3737
$headers
3838
);
3939

40-
$factory->assertSent(static function (Request $request, Response $response) use ($url, $messageData): bool {
41-
return !$request->hasHeader('Authorization')
40+
$factory->assertSent(static fn(Request $request, Response $response): bool => !$request->hasHeader('Authorization')
4241
&& $request->url() === $url
43-
&& $request->data() === $messageData;
44-
});
42+
&& $request->data() === $messageData);
4543
}
4644

4745
public function testARequestCanBeSentToTheTwilioApiWithCredentials(): void
@@ -72,11 +70,9 @@ public function testARequestCanBeSentToTheTwilioApiWithCredentials(): void
7270
'password'
7371
);
7472

75-
$factory->assertSent(static function (Request $request, Response $response) use ($url, $messageData): bool {
76-
return $request->hasHeader('Authorization')
73+
$factory->assertSent(static fn(Request $request, Response $response): bool => $request->hasHeader('Authorization')
7774
&& $request->url() === $url
78-
&& $request->data() === $messageData;
79-
});
75+
&& $request->data() === $messageData);
8076
}
8177

8278
public function testAnExceptionIsThrownWhenThereIsAnErrorPerformingTheRequest(): void

0 commit comments

Comments
 (0)