From aea010290e8e1d12425141a7a7cd38f77629fa23 Mon Sep 17 00:00:00 2001 From: Gautam Garg <65900807+knit-pay@users.noreply.github.com> Date: Tue, 24 Feb 2026 01:07:01 +0530 Subject: [PATCH 1/4] Update DateTimeTrait.php Fixed PHP Deprecated: Pronamic\WordPress\DateTime\DateTimeTrait::create_from_format(): Implicitly marking parameter $timezone as nullable is deprecated, the explicit nullable type must be used instead --- src/DateTimeTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DateTimeTrait.php b/src/DateTimeTrait.php index 734fc65..eb6d8bb 100644 --- a/src/DateTimeTrait.php +++ b/src/DateTimeTrait.php @@ -280,7 +280,7 @@ public static function createFromFormat( // phpcs:ignore WordPress.NamingConvent * @return self|false */ #[\ReturnTypeWillChange] - public static function create_from_format( $format, $time, \DateTimeZone $timezone = null ) { + public static function create_from_format( $format, $time, ?\DateTimeZone $timezone = null ) { /* * In PHP 5.6 or lower it's not possible to pass in an empty (null) timezone object. * This will result in a `DateTime::createFromFormat() expects parameter 3 to be DateTimeZone, null given` error. From bdc67813e72337b1f33b9a47be19fccc6f6cedd3 Mon Sep 17 00:00:00 2001 From: Gautam Garg <65900807+knit-pay@users.noreply.github.com> Date: Tue, 24 Feb 2026 01:07:49 +0530 Subject: [PATCH 2/4] Update DateTimeInterface.php Fixed PHP Deprecated: Pronamic\WordPress\DateTime\DateTimeInterface::create_from_format(): Implicitly marking parameter $timezone as nullable is deprecated, the explicit nullable type must be used instead --- src/DateTimeInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DateTimeInterface.php b/src/DateTimeInterface.php index d6ba0dc..ace604d 100644 --- a/src/DateTimeInterface.php +++ b/src/DateTimeInterface.php @@ -110,5 +110,5 @@ public function format_i18n( $format = null ); * @param \DateTimeZone $timezone A DateTimeZone object representing the desired time zone. * @return self|false */ - public static function create_from_format( $format, $time, \DateTimeZone $timezone = null ); + public static function create_from_format( $format, $time, ?\DateTimeZone $timezone = null ); } From 571015c80d4c96b1360bb9b78e9c0c57396bb620 Mon Sep 17 00:00:00 2001 From: Gautam Garg <65900807+knit-pay@users.noreply.github.com> Date: Wed, 25 Feb 2026 13:56:59 +0530 Subject: [PATCH 3/4] Update DateTimeInterface.php Update PHPDoc suggested by Gemini Code Review. --- src/DateTimeInterface.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DateTimeInterface.php b/src/DateTimeInterface.php index ace604d..8b872a8 100644 --- a/src/DateTimeInterface.php +++ b/src/DateTimeInterface.php @@ -105,9 +105,9 @@ public function format_i18n( $format = null ); * @link https://www.php.net/manual/en/datetime.createfromformat.php * @link https://www.php.net/manual/en/datetimeimmutable.createfromformat.php * - * @param string $format Format accepted by date(). - * @param string $time String representing the time. - * @param \DateTimeZone $timezone A DateTimeZone object representing the desired time zone. + * @param string $format Format accepted by date(). + * @param string $time String representing the time. + * @param \DateTimeZone|null $timezone A DateTimeZone object representing the desired time zone. * @return self|false */ public static function create_from_format( $format, $time, ?\DateTimeZone $timezone = null ); From 055c7d6c4b97a131d9d7b7e772bfa7da85b4286f Mon Sep 17 00:00:00 2001 From: Gautam Garg <65900807+knit-pay@users.noreply.github.com> Date: Wed, 25 Feb 2026 13:58:04 +0530 Subject: [PATCH 4/4] Update DateTimeTrait.php Update PHPDoc suggested by Gemini Code Review. --- src/DateTimeTrait.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DateTimeTrait.php b/src/DateTimeTrait.php index eb6d8bb..c891a94 100644 --- a/src/DateTimeTrait.php +++ b/src/DateTimeTrait.php @@ -273,9 +273,9 @@ public static function createFromFormat( // phpcs:ignore WordPress.NamingConvent * * @since 1.0.1 * - * @param string $format Format accepted by date(). - * @param string $time String representing the time. - * @param \DateTimeZone $timezone A DateTimeZone object representing the desired time zone. + * @param string $format Format accepted by date(). + * @param string $time String representing the time. + * @param \DateTimeZone|null $timezone A DateTimeZone object representing the desired time zone. * * @return self|false */