Skip to content

Commit d442cb7

Browse files
authored
PHP 8.2 build (#349)
* PHP 8.2 build * Update phpunit.xml.dist * Update phpunit.xml.dist * Update Client.php * Update Client.php * Update Client.php * Update Client.php * Update Client.php
1 parent e085414 commit d442cb7

File tree

5 files changed

+18
-7
lines changed

5 files changed

+18
-7
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
php: [ '7.4', '8.0', '8.1' ]
11+
php: [ '7.4', '8.0', '8.1', '8.2' ]
1212
name: PHP ${{ matrix.php }} Test
1313

1414
steps:

phpunit.xml.dist

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
bootstrap="vendor/autoload.php"
66
colors="true"
77
backupGlobals="true"
8+
convertDeprecationsToExceptions="true"
89
convertErrorsToExceptions="true"
910
convertNoticesToExceptions="true"
1011
convertWarningsToExceptions="true"
1112
stopOnFailure="false"
12-
>
13+
>
1314
<coverage processUncoveredFiles="true">
1415
<include>
1516
<directory suffix=".php">src</directory>

src/Client.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,16 @@ class Client implements LoggerAwareInterface
131131
* @var array
132132
*/
133133
protected $options = ['show_deprecations' => false, 'debug' => false];
134+
135+
/**
136+
* @string
137+
*/
138+
public $apiUrl;
139+
140+
/**
141+
* @string
142+
*/
143+
public $restUrl;
134144

135145
/**
136146
* Create a new API client using the provided credentials.

src/SMS/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function getAPIResource(): APIResource
3636

3737
public function isUnicode($message): bool
3838
{
39-
return strlen($message) !== strlen(utf8_decode($message));
39+
return strlen($message) !== strlen(mb_convert_encoding($message, 'ISO-8859-1', 'UTF-8'));
4040
}
4141

4242
/**

src/Secrets/Client.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ public function getAPIResource(): APIResource
2626

2727
public function get(string $accountId, string $id): Secret
2828
{
29-
$data = $this->api->get("${accountId}/secrets/${id}");
29+
$data = $this->api->get("{$accountId}/secrets/{$id}");
3030

3131
return new Secret($data);
3232
}
3333

3434
public function list(string $accountId): IterableAPICollection
3535
{
36-
$collection = $this->api->search(null, "/accounts/${accountId}/secrets");
36+
$collection = $this->api->search(null, "/accounts/{$accountId}/secrets");
3737
$hydrator = new ArrayHydrator();
3838
$hydrator->setPrototype(new Secret());
3939
$collection->setHydrator($hydrator);
@@ -43,12 +43,12 @@ public function list(string $accountId): IterableAPICollection
4343

4444
public function create(string $accountId, string $secret): Secret
4545
{
46-
$response = $this->api->create(['secret' => $secret], "/${accountId}/secrets");
46+
$response = $this->api->create(['secret' => $secret], "/{$accountId}/secrets");
4747
return new Secret($response);
4848
}
4949

5050
public function revoke(string $accountId, string $id)
5151
{
52-
$this->api->delete("${accountId}/secrets/${id}");
52+
$this->api->delete("{$accountId}/secrets/{$id}");
5353
}
5454
}

0 commit comments

Comments
 (0)