Skip to content

Commit

Permalink
fix: deprecations in PHP 8.4 (#1119)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
theodorejb and manisha1997 authored Feb 22, 2025
1 parent 8aa2325 commit 4214041
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
timeout-minutes: 20
strategy:
matrix:
php: [ '7.3', '7.4', '8.0', '8.1' ]
php: [ '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
env:
DOCKER_LOGIN: ${{ secrets.DOCKER_USERNAME && secrets.DOCKER_AUTH_TOKEN }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Please note that we utilize the [Gitflow Workflow](https://www.atlassian.com/git

##### Prerequisites #####

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

##### Initial setup: #####

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ We appreciate your continued support, thank you!

## Prerequisites

- PHP version 7.3, 7.4, 8.0, or 8.1
- PHP version 7.3+
- 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).
- For SMS messages, you will need a free [Twilio account](https://www.twilio.com/try-twilio?source=sendgrid-php).

Expand Down
2 changes: 1 addition & 1 deletion lib/mail/Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function __construct(
$subject = null,
$plainTextContent = null,
$htmlContent = null,
array $globalSubstitutions = null
?array $globalSubstitutions = null
) {
if (!isset($from)
&& !isset($to)
Expand Down
6 changes: 3 additions & 3 deletions lib/stats/Stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,15 @@ public function getSubuserMonthly(
}

/**
* Validate the date format
* Validate YYYY-MM-DD date format
*
* @param string $date YYYY-MM-DD
* @param string|null $date
*
* @throws Exception
*/
protected function validateDateFormat($date)
{
if (false === DateTime::createFromFormat(self::DATE_FORMAT, $date)) {
if (is_null($date) || !DateTime::createFromFormat(self::DATE_FORMAT, $date)) {
throw new Exception('Date must be in the YYYY-MM-DD format.');
}
}
Expand Down

0 comments on commit 4214041

Please sign in to comment.