From 06294cabc4ad8e82110b205e77ee8a8f58a9dbd6 Mon Sep 17 00:00:00 2001 From: Theodore Brown Date: Wed, 12 Feb 2025 12:06:13 -0600 Subject: [PATCH 1/4] Fix implicitly nullable parameter deprecation in PHP 8.4 --- lib/mail/Mail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mail/Mail.php b/lib/mail/Mail.php index c8511852..3c1f446b 100644 --- a/lib/mail/Mail.php +++ b/lib/mail/Mail.php @@ -101,7 +101,7 @@ public function __construct( $subject = null, $plainTextContent = null, $htmlContent = null, - array $globalSubstitutions = null + ?array $globalSubstitutions = null ) { if (!isset($from) && !isset($to) From bf2afea1d9153b63f8e909c1ceb238c866db7fca Mon Sep 17 00:00:00 2001 From: Theodore Brown Date: Wed, 12 Feb 2025 12:10:45 -0600 Subject: [PATCH 2/4] Fix deprecation message for passing null to DateTime::createFromFormat() --- lib/stats/Stats.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/stats/Stats.php b/lib/stats/Stats.php index 070816b2..6bcc27f8 100644 --- a/lib/stats/Stats.php +++ b/lib/stats/Stats.php @@ -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.'); } } From aa1b6651572cf571fb96b414068326a353ff6e15 Mon Sep 17 00:00:00 2001 From: Theodore Brown Date: Mon, 17 Feb 2025 10:30:20 -0600 Subject: [PATCH 3/4] Test on PHP 8.2, 8.3, and 8.4 --- .github/workflows/test-and-deploy.yml | 2 +- CONTRIBUTING.md | 2 +- README.md | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index 1ebe7919..151a0188 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -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: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 37d2cb7c..5df17e41 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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: ##### diff --git a/README.md b/README.md index b28d1634..9a188ee2 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ **This library allows you to quickly and easily use the Twilio SendGrid Web API v3 via PHP.** -Version 7.X.X of this library provides full support for all Twilio SendGrid [Web API v3](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html) endpoints, including the new [v3 /mail/send](https://sendgrid.com/blog/introducing-v3mailsend-sendgrids-new-mail-endpoint). +This library provides full support for all Twilio SendGrid [Web API v3](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html) endpoints, including the new [v3 /mail/send](https://sendgrid.com/blog/introducing-v3mailsend-sendgrids-new-mail-endpoint). **If you need support using SendGrid, please check the [Twilio SendGrid Support Help Center](https://support.sendgrid.com).** @@ -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). @@ -171,8 +171,6 @@ try { # Announcements -v7 has been released! Please see the [release notes](https://github.com/sendgrid/sendgrid-php/releases/tag/v7.0.0) for details. - All updates to this library are documented in our [CHANGELOG](CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-php/releases). From 535d4c6e1454e38db9704e4eba82d473236d580d Mon Sep 17 00:00:00 2001 From: Manisha Singh Date: Sat, 22 Feb 2025 12:49:53 +0530 Subject: [PATCH 4/4] chore: Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a188ee2..dd504a14 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ **This library allows you to quickly and easily use the Twilio SendGrid Web API v3 via PHP.** -This library provides full support for all Twilio SendGrid [Web API v3](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html) endpoints, including the new [v3 /mail/send](https://sendgrid.com/blog/introducing-v3mailsend-sendgrids-new-mail-endpoint). +Version 7.X.X of this library provides full support for all Twilio SendGrid [Web API v3](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html) endpoints, including the new [v3 /mail/send](https://sendgrid.com/blog/introducing-v3mailsend-sendgrids-new-mail-endpoint). **If you need support using SendGrid, please check the [Twilio SendGrid Support Help Center](https://support.sendgrid.com).** @@ -171,6 +171,8 @@ try { # Announcements +v7 has been released! Please see the [release notes](https://github.com/sendgrid/sendgrid-php/releases/tag/v7.0.0) for details. + All updates to this library are documented in our [CHANGELOG](CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-php/releases).