Skip to content

Commit 0f93319

Browse files
authored
Merge pull request #2 from knit-pay/php8.5-patch
Php8.5 patch
2 parents ffea6a3 + 055c7d6 commit 0f93319

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/DateTimeInterface.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ public function format_i18n( $format = null );
105105
* @link https://www.php.net/manual/en/datetime.createfromformat.php
106106
* @link https://www.php.net/manual/en/datetimeimmutable.createfromformat.php
107107
*
108-
* @param string $format Format accepted by date().
109-
* @param string $time String representing the time.
110-
* @param \DateTimeZone $timezone A DateTimeZone object representing the desired time zone.
108+
* @param string $format Format accepted by date().
109+
* @param string $time String representing the time.
110+
* @param \DateTimeZone|null $timezone A DateTimeZone object representing the desired time zone.
111111
* @return self|false
112112
*/
113-
public static function create_from_format( $format, $time, \DateTimeZone $timezone = null );
113+
public static function create_from_format( $format, $time, ?\DateTimeZone $timezone = null );
114114
}

src/DateTimeTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,14 +273,14 @@ public static function createFromFormat( // phpcs:ignore WordPress.NamingConvent
273273
*
274274
* @since 1.0.1
275275
*
276-
* @param string $format Format accepted by date().
277-
* @param string $time String representing the time.
278-
* @param \DateTimeZone $timezone A DateTimeZone object representing the desired time zone.
276+
* @param string $format Format accepted by date().
277+
* @param string $time String representing the time.
278+
* @param \DateTimeZone|null $timezone A DateTimeZone object representing the desired time zone.
279279
*
280280
* @return self|false
281281
*/
282282
#[\ReturnTypeWillChange]
283-
public static function create_from_format( $format, $time, \DateTimeZone $timezone = null ) {
283+
public static function create_from_format( $format, $time, ?\DateTimeZone $timezone = null ) {
284284
/*
285285
* In PHP 5.6 or lower it's not possible to pass in an empty (null) timezone object.
286286
* This will result in a `DateTime::createFromFormat() expects parameter 3 to be DateTimeZone, null given` error.

0 commit comments

Comments
 (0)