Skip to content

Commit bac4b28

Browse files
authored
Merge branch 'main' into PHP8.4Take2
2 parents 5254a57 + 6fd8a3e commit bac4b28

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+602
-236
lines changed

CHANGES.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,40 @@
11
twilio-php Changelog
22
====================
33

4+
[2025-01-13] Version 8.3.12
5+
---------------------------
6+
**Library - Chore**
7+
- [PR #841](https://github.com/twilio/twilio-php/pull/841): update changelog for 8.3.11. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!
8+
- [PR #840](https://github.com/twilio/twilio-php/pull/840): fix model names in json serialize and payload. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!
9+
10+
**Library - Fix**
11+
- [PR #839](https://github.com/twilio/twilio-php/pull/839): Php8.4 take 2. Thanks to [@phpfui](https://github.com/phpfui)!
12+
13+
**Messaging**
14+
- Adds validity period Default value in service resource documentation
15+
16+
17+
[2025-01-10] Version 8.3.11
18+
---------------------------
19+
**Library - Fix**
20+
- [PR #839](https://github.com/twilio/twilio-php/pull/839): Php8.4 take 2. Thanks to [@phpfui](https://github.com/phpfui)!
21+
22+
**Library - Chore**
23+
- [PR #840](https://github.com/twilio/twilio-php/pull/840): fix model names in json serialize and payload. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!
24+
25+
26+
[2025-01-09] Version 8.3.10
27+
---------------------------
28+
**Library - Fix**
29+
- [PR #834](https://github.com/twilio/twilio-php/pull/834): avoid deprecation messages for PHP 8.4. Thanks to [@phpfui](https://github.com/phpfui)!
30+
31+
**Library - Chore**
32+
- [PR #837](https://github.com/twilio/twilio-php/pull/837): revert 'fix: avoid deprecation messages for PHP 8.4'. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!
33+
34+
**Numbers**
35+
- Change beta feature flag to use v2/BulkHostedNumberOrders
36+
37+
438
[2024-12-05] Version 8.3.9
539
--------------------------
640
**Api**

example/message.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
$messageList = $client->messages->read([],10);
2929
foreach ($messageList as $msg) {
3030
print("ID:: ". $msg->sid . " | " . "From:: " . $msg->from . " | " . "TO:: " . $msg->to . " | " . " Status:: " . $msg->status . " | " . " Body:: ". $msg->body ."\n");
31-
}
31+
}

src/Twilio/Base/BaseClient.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ class BaseClient
4949
* @throws ConfigurationException If valid authentication is not present
5050
*/
5151
public function __construct(
52-
string $username = null,
53-
string $password = null,
54-
string $accountSid = null,
55-
string $region = null,
56-
HttpClient $httpClient = null,
57-
array $environment = null,
58-
array $userAgentExtensions = null
52+
?string $username = null,
53+
?string $password = null,
54+
?string $accountSid = null,
55+
?string $region = null,
56+
?HttpClient $httpClient = null,
57+
?array $environment = null,
58+
?array $userAgentExtensions = null
5959
) {
6060
$this->environment = $environment ?: \getenv();
6161

@@ -119,9 +119,9 @@ public function request(
119119
array $params = [],
120120
array $data = [],
121121
array $headers = [],
122-
string $username = null,
123-
string $password = null,
124-
int $timeout = null
122+
?string $username = null,
123+
?string $password = null,
124+
?int $timeout = null
125125
): \Twilio\Http\Response{
126126
$username = $username ?: $this->username;
127127
$password = $password ?: $this->password;
@@ -341,7 +341,7 @@ public function getEdge(): string
341341
*
342342
* @param string $uri Edge to use, unsets the Edge when called with no arguments
343343
*/
344-
public function setEdge(string $edge = null): void
344+
public function setEdge(?string $edge = null): void
345345
{
346346
$this->edge = $this->getArg($edge, self::ENV_EDGE);
347347
}
@@ -381,7 +381,7 @@ public function getLogLevel(): ?string
381381
*
382382
* @param string $logLevel log level to use
383383
*/
384-
public function setLogLevel(string $logLevel = null): void
384+
public function setLogLevel(?string $logLevel = null): void
385385
{
386386
$this->logLevel = $this->getArg($logLevel, self::ENV_LOG);
387387
}

src/Twilio/Domain.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ public function absoluteUrl(string $uri): string {
5757
*/
5858
public function request(string $method, string $uri,
5959
array $params = [], array $data = [], array $headers = [],
60-
string $user = null, string $password = null,
61-
int $timeout = null): Response {
60+
?string $user = null, ?string $password = null,
61+
?int $timeout = null): Response {
6262
$url = $this->absoluteUrl($uri);
6363
return $this->client->request(
6464
$method,

src/Twilio/Http/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
interface Client {
88
public function request(string $method, string $url,
99
array $params = [], array $data = [], array $headers = [],
10-
string $user = null, string $password = null,
11-
int $timeout = null): Response;
10+
?string $user = null, ?string $password = null,
11+
?int $timeout = null): Response;
1212
}

src/Twilio/Http/CurlClient.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ public function __construct(array $options = []) {
2020

2121
public function request(string $method, string $url,
2222
array $params = [], array $data = [], array $headers = [],
23-
string $user = null, string $password = null,
24-
int $timeout = null): Response {
23+
?string $user = null, ?string $password = null,
24+
?int $timeout = null): Response {
2525
$options = $this->options($method, $url, $params, $data, $headers,
2626
$user, $password, $timeout);
2727

@@ -85,8 +85,8 @@ public function request(string $method, string $url,
8585

8686
public function options(string $method, string $url,
8787
array $params = [], array $data = [], array $headers = [],
88-
string $user = null, string $password = null,
89-
int $timeout = null): array {
88+
?string $user = null, ?string $password = null,
89+
?int $timeout = null): array {
9090
$timeout = $timeout ?? self::DEFAULT_TIMEOUT;
9191
$options = $this->curlOptions + [
9292
CURLOPT_URL => $url,

src/Twilio/Http/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class File {
2424
* @param string|resource|mixed|null $contents
2525
* @param string $contentType
2626
*/
27-
public function __construct(string $fileName, $contents = null, string $contentType = null) {
27+
public function __construct(string $fileName, $contents = null, ?string $contentType = null) {
2828
$this->fileName = $fileName;
2929
$this->contents = $contents;
3030
$this->contentType = $contentType;

src/Twilio/Http/GuzzleClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public function __construct(ClientInterface $client) {
2222

2323
public function request(string $method, string $url,
2424
array $params = [], array $data = [], array $headers = [],
25-
string $user = null, string $password = null,
26-
int $timeout = null): Response {
25+
?string $user = null, ?string $password = null,
26+
?int $timeout = null): Response {
2727
try {
2828
$options = [
2929
'timeout' => $timeout,

src/Twilio/Jwt/AccessToken.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class AccessToken {
1818
/** @var string[] $customClaims */
1919
private $customClaims;
2020

21-
public function __construct(string $accountSid, string $signingKeySid, string $secret, int $ttl = 3600, string $identity = null, string $region = null) {
21+
public function __construct(string $accountSid, string $signingKeySid, string $secret, int $ttl = 3600, ?string $identity = null, ?string $region = null) {
2222
$this->signingKeySid = $signingKeySid;
2323
$this->accountSid = $accountSid;
2424
$this->secret = $secret;

src/Twilio/Jwt/JWT.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class JWT {
1919
* @throws \DomainException
2020
* @throws \UnexpectedValueException
2121
*/
22-
public static function decode(string $jwt, string $key = null, bool $verify = true) {
22+
public static function decode(string $jwt, ?string $key = null, bool $verify = true) {
2323
$tks = \explode('.', $jwt);
2424
if (\count($tks) !== 3) {
2525
throw new \UnexpectedValueException('Wrong number of segments');

0 commit comments

Comments
 (0)