Skip to content

Commit 4214041

Browse files
fix: deprecations in PHP 8.4 (#1119)
* Fix implicitly nullable parameter deprecation in PHP 8.4 * Fix deprecation message for passing null to DateTime::createFromFormat() * Test on PHP 8.2, 8.3, and 8.4 * chore: Update README.md --------- Co-authored-by: Manisha Singh <singhmanisha.250025@gmail.com>
1 parent 8aa2325 commit 4214041

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

.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.3', '7.4', '8.0', '8.1' ]
20+
php: [ '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
2121
env:
2222
DOCKER_LOGIN: ${{ secrets.DOCKER_USERNAME && secrets.DOCKER_AUTH_TOKEN }}
2323
steps:

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Please note that we utilize the [Gitflow Workflow](https://www.atlassian.com/git
2929

3030
##### Prerequisites #####
3131

32-
- PHP version 7.3, 7.4, 8.0, or 8.1
32+
- PHP version 7.3+
3333

3434
##### Initial setup: #####
3535

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ We appreciate your continued support, thank you!
4040

4141
## Prerequisites
4242

43-
- PHP version 7.3, 7.4, 8.0, or 8.1
43+
- PHP version 7.3+
4444
- The Twilio SendGrid service, starting at the [free level](https://sendgrid.com/free?source=sendgrid-php) to send up to 40,000 emails for the first 30 days, then send 100 emails/day free forever or check out [our pricing](https://sendgrid.com/pricing?source=sendgrid-php).
4545
- For SMS messages, you will need a free [Twilio account](https://www.twilio.com/try-twilio?source=sendgrid-php).
4646

lib/mail/Mail.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function __construct(
101101
$subject = null,
102102
$plainTextContent = null,
103103
$htmlContent = null,
104-
array $globalSubstitutions = null
104+
?array $globalSubstitutions = null
105105
) {
106106
if (!isset($from)
107107
&& !isset($to)

lib/stats/Stats.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,15 @@ public function getSubuserMonthly(
189189
}
190190

191191
/**
192-
* Validate the date format
192+
* Validate YYYY-MM-DD date format
193193
*
194-
* @param string $date YYYY-MM-DD
194+
* @param string|null $date
195195
*
196196
* @throws Exception
197197
*/
198198
protected function validateDateFormat($date)
199199
{
200-
if (false === DateTime::createFromFormat(self::DATE_FORMAT, $date)) {
200+
if (is_null($date) || !DateTime::createFromFormat(self::DATE_FORMAT, $date)) {
201201
throw new Exception('Date must be in the YYYY-MM-DD format.');
202202
}
203203
}

0 commit comments

Comments
 (0)