Skip to content

Commit 97c41bd

Browse files
authored
PHP8.4 (#528)
* Added 8.4 to fire in matrix versions * PHP8.4 nullcheck fixes * phpstan checks
1 parent 945eec9 commit 97c41bd

File tree

15 files changed

+29
-22
lines changed

15 files changed

+29
-22
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ubuntu-latest
2222
strategy:
2323
matrix:
24-
php: ['8.1', '8.2', '8.3']
24+
php: ['8.1', '8.2', '8.3', '8.4']
2525

2626
name: PHP ${{ matrix.php }} Test
2727

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: ubuntu-latest
2424
strategy:
2525
matrix:
26-
php: [ '8.1', '8.2', '8.3' ]
26+
php: [ '8.1', '8.2', '8.3', '8.4' ]
2727

2828
name: PHP ${{ matrix.php }} Test
2929

src/Account/Config.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ class Config implements
1919
public function __construct(
2020
?string $sms_callback_url = null,
2121
?string $dr_callback_url = null,
22-
int|string $max_outbound_request = null,
23-
int|string $max_inbound_request = null,
24-
int|string $max_calls_per_second = null
22+
int|string|null $max_outbound_request = null,
23+
int|string|null $max_inbound_request = null,
24+
int|string|null $max_calls_per_second = null
2525
) {
2626
if (!is_null($sms_callback_url)) {
2727
$this->data['sms_callback_url'] = $sms_callback_url;

src/Client.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,13 @@ public function __construct(
231231
// Disable throwing E_USER_DEPRECATED notices by default, the user can turn it on during development
232232
if (array_key_exists('show_deprecations', $this->options) && ($this->options['show_deprecations'] == true)) {
233233
set_error_handler(
234-
static fn (int $errno, string $errstr, string $errfile = null, int $errline = null, array $errorcontext = null) => true,
234+
static fn (
235+
int $errno,
236+
string $errstr,
237+
?string $errfile = null,
238+
?int $errline = null,
239+
?array $errorcontext = null
240+
) => true,
235241
E_USER_DEPRECATED
236242
);
237243
}

src/Client/Exception/Validation.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Validation extends Request
1111
public function __construct(
1212
string $message = '',
1313
int $code = 0,
14-
Throwable $previous = null,
14+
?Throwable $previous = null,
1515
private readonly array $errors = []
1616
) {
1717
parent::__construct($message, $code, $previous);

src/Conversation/Client.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ public function getAPIResource(): APIResource
3030
return $this->api;
3131
}
3232

33-
public function listConversations(ListConversationFilter $conversationFilter = null): IterableAPICollection
34-
{
33+
public function listConversations(
34+
?ListConversationFilter $conversationFilter = null
35+
): IterableAPICollection {
3536
if (!$conversationFilter) {
3637
$conversationFilter = new ListConversationFilter();
3738
}

src/Meetings/Client.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function updateRoom(string $id, array $payload): Room
9090
return $room;
9191
}
9292

93-
public function getAllListedRooms(string $start_id = null, string $end_id = null, int $size = 20): array
93+
public function getAllListedRooms(?string $start_id = null, ?string $end_id = null, int $size = 20): array
9494
{
9595
$filterParams = [];
9696

@@ -233,7 +233,7 @@ public function updateTheme(string $id, array $payload): ?ApplicationTheme
233233
return $applicationTheme;
234234
}
235235

236-
public function getRoomsByThemeId(string $themeId, string $startId = null, string $endId = null, int $size = 20): array
236+
public function getRoomsByThemeId(string $themeId, ?string $startId = null, ?string $endId = null, int $size = 20): array
237237
{
238238
$this->api->setIsHAL(true);
239239
$this->api->setCollectionName('rooms');

src/Numbers/Client.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function get(string $number): Number
106106
* @throws ClientException\Request
107107
* @throws ClientException\Server
108108
*/
109-
public function searchAvailable(string $country, FilterInterface $options = null): array
109+
public function searchAvailable(string $country, ?FilterInterface $options = null): array
110110
{
111111
if (is_null($options)) {
112112
$options = new AvailableNumbers([
@@ -134,7 +134,7 @@ public function searchAvailable(string $country, FilterInterface $options = null
134134
* @throws ClientException\Request
135135
* @throws ClientException\Server
136136
*/
137-
public function searchOwned($number = null, FilterInterface $options = null): array
137+
public function searchOwned($number = null, ?FilterInterface $options = null): array
138138
{
139139
if ($number !== null) {
140140
if ($options !== null) {

src/Subaccount/Client.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function updateSubaccount(string $apiKey, string $subaccountApiKey, Accou
8686
return $this->api->partiallyUpdate($apiKey . '/subaccounts/' . $subaccountApiKey, $account->toArray());
8787
}
8888

89-
public function getCreditTransfers(string $apiKey, FilterInterface $filter = null): mixed
89+
public function getCreditTransfers(string $apiKey, ?FilterInterface $filter = null): mixed
9090
{
9191
if (!$filter) {
9292
$filter = new EmptyFilter();
@@ -101,7 +101,7 @@ public function getCreditTransfers(string $apiKey, FilterInterface $filter = nul
101101
return array_map(fn ($item) => $hydrator->hydrate($item), $transfers);
102102
}
103103

104-
public function getBalanceTransfers(string $apiKey, FilterInterface $filter = null): mixed
104+
public function getBalanceTransfers(string $apiKey, ?FilterInterface $filter = null): mixed
105105
{
106106
if (!$filter) {
107107
$filter = new EmptyFilter();

src/Users/Client.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function getApiResource(): APIResource
2929
return $this->api;
3030
}
3131

32-
public function listUsers(FilterInterface $filter = null): IterableAPICollection
32+
public function listUsers(?FilterInterface $filter = null): IterableAPICollection
3333
{
3434
if (is_null($filter)) {
3535
$filter = new EmptyFilter();

src/Verify/Client.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public function trigger($verification): Verification
178178
* @throws ClientException\Request
179179
* @throws ClientException\Server
180180
*/
181-
public function check(Verification|array|string $verification, string $code, string $ip = null): Verification
181+
public function check(Verification|array|string $verification, string $code, ?string $ip = null): Verification
182182
{
183183
if (is_array($verification)) {
184184
trigger_error(

src/Verify/RequestPSD2.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct(
3939
protected string $number,
4040
protected string $payee,
4141
protected string $amount,
42-
int $workflowId = null
42+
?int $workflowId = null
4343
) {
4444
if ($workflowId) {
4545
$this->setWorkflowId($workflowId);

src/Verify2/Client.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static function isSilentAuthRequest(BaseVerifyRequest $request): bool
8282
return false;
8383
}
8484

85-
public function listCustomTemplates(TemplateFilter $filter = null): IterableAPICollection
85+
public function listCustomTemplates(?TemplateFilter $filter = null): IterableAPICollection
8686
{
8787
$collection = $this->api->search($filter, '/templates');
8888
$collection->setNaiveCount(true);
@@ -158,7 +158,7 @@ public function deleteCustomTemplateFragment(string $templateId, string $fragmen
158158
return true;
159159
}
160160

161-
public function listTemplateFragments(string $templateId, TemplateFilter $filter = null): IterableAPICollection
161+
public function listTemplateFragments(string $templateId, ?TemplateFilter $filter = null): IterableAPICollection
162162
{
163163
$api = clone $this->getAPIResource();
164164
$api->setCollectionName('template_fragments');

src/Voice/Client.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public function playTTS(string $callId, Talk $action): array
182182
return $this->api->update($callId . '/talk', $payload);
183183
}
184184

185-
public function search(FilterInterface $filter = null): IterableAPICollection
185+
public function search(?FilterInterface $filter = null): IterableAPICollection
186186
{
187187
$response = $this->api->search($filter);
188188
$response->setApiResource(clone $this->api);

test/ProactiveConnect/ClientTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ public function testWillDownloadItemCsv(): void
570570
fwrite($handle, (string) $response->getContents());
571571
fseek($handle, 0);
572572

573-
while (($row = fgetcsv($handle)) !== false) {
573+
while (($row = fgetcsv($handle, 0, ',', '"', '\\')) !== false) {
574574
if (!$header) {
575575
$header = $row;
576576
} else {

0 commit comments

Comments
 (0)