Skip to content

Commit 1df304c

Browse files
chore: revert 'fix: avoid deprecation messages for PHP 8.4' (#837)
1 parent 6753a82 commit 1df304c

24 files changed

+55
-57
lines changed

.github/workflows/test-and-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
timeout-minutes: 20
1818
strategy:
1919
matrix:
20-
php: [ 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4 ]
20+
php: [ 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3 ]
2121
dependencies:
2222
- "lowest"
2323
- "highest"

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');

src/Twilio/Jwt/TaskRouter/CapabilityToken.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class CapabilityToken {
3131
protected $optional = ['required' => false];
3232

3333
public function __construct(string $accountSid, string $authToken, string $workspaceSid, string $channelId,
34-
?string $resourceUrl = null, ?string $overrideBaseUrl = null, ?string $overrideBaseWSUrl = null) {
34+
string $resourceUrl = null, string $overrideBaseUrl = null, string $overrideBaseWSUrl = null) {
3535
$this->accountSid = $accountSid;
3636
$this->authToken = $authToken;
3737
$this->friendlyName = $channelId;

0 commit comments

Comments
 (0)