upgrade idiorm to php8.1-patched version (aaronpk/idiorm)
This commit is contained in:
@@ -2,10 +2,6 @@
|
||||
|
||||
namespace Safe;
|
||||
|
||||
use DateInterval;
|
||||
use DateTime;
|
||||
use DateTimeInterface;
|
||||
use DateTimeZone;
|
||||
use Safe\Exceptions\DatetimeException;
|
||||
|
||||
/**
|
||||
@@ -23,7 +19,7 @@ class DateTimeImmutable extends \DateTimeImmutable
|
||||
/**
|
||||
* DateTimeImmutable constructor.
|
||||
* @param string $time
|
||||
* @param DateTimeZone|null $timezone
|
||||
* @param \DateTimeZone|null $timezone
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function __construct($time = 'now', $timezone = null)
|
||||
@@ -52,12 +48,12 @@ class DateTimeImmutable extends \DateTimeImmutable
|
||||
/**
|
||||
* @param string $format
|
||||
* @param string $time
|
||||
* @param DateTimeZone|null $timezone
|
||||
* @param \DateTimeZone|null $timezone
|
||||
* @throws DatetimeException
|
||||
*/
|
||||
public static function createFromFormat($format, $time, $timezone = null): self
|
||||
{
|
||||
$datetime = parent::createFromFormat($format, $time, $timezone);
|
||||
$datetime = \DateTimeImmutable::createFromFormat($format, $time, $timezone);
|
||||
if ($datetime === false) {
|
||||
throw DatetimeException::createFromPhpError();
|
||||
}
|
||||
@@ -80,12 +76,12 @@ class DateTimeImmutable extends \DateTimeImmutable
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DateTimeInterface $datetime2
|
||||
* @param \DateTimeInterface $datetime2
|
||||
* @param bool $absolute
|
||||
* @return DateInterval
|
||||
* @return \DateInterval
|
||||
* @throws DatetimeException
|
||||
*/
|
||||
public function diff($datetime2, $absolute = false): DateInterval
|
||||
public function diff($datetime2, $absolute = false): \DateInterval
|
||||
{
|
||||
/** @var \DateInterval|false $result */
|
||||
$result = $this->innerDateTime->diff($datetime2, $absolute);
|
||||
@@ -178,7 +174,7 @@ class DateTimeImmutable extends \DateTimeImmutable
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DateTimeZone $timezone
|
||||
* @param \DateTimeZone $timezone
|
||||
* @return DateTimeImmutable
|
||||
* @throws DatetimeException
|
||||
*/
|
||||
@@ -193,7 +189,7 @@ class DateTimeImmutable extends \DateTimeImmutable
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DateInterval $interval
|
||||
* @param \DateInterval $interval
|
||||
* @return DateTimeImmutable
|
||||
* @throws DatetimeException
|
||||
*/
|
||||
@@ -224,7 +220,7 @@ class DateTimeImmutable extends \DateTimeImmutable
|
||||
//overload getters to use the inner datetime immutable instead of itself
|
||||
|
||||
/**
|
||||
* @param DateInterval $interval
|
||||
* @param \DateInterval $interval
|
||||
* @return DateTimeImmutable
|
||||
*/
|
||||
public function add($interval): self
|
||||
@@ -233,12 +229,14 @@ class DateTimeImmutable extends \DateTimeImmutable
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DateTime $dateTime
|
||||
* @param \DateTime $dateTime
|
||||
* @return DateTimeImmutable
|
||||
*/
|
||||
public static function createFromMutable($dateTime): self
|
||||
{
|
||||
return self::createFromRegular(parent::createFromMutable($dateTime));
|
||||
$date = \DateTimeImmutable::createFromMutable($dateTime);
|
||||
|
||||
return self::createFromRegular($date);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -250,7 +248,7 @@ class DateTimeImmutable extends \DateTimeImmutable
|
||||
return self::createFromRegular(parent::__set_state($array));
|
||||
}
|
||||
|
||||
public function getTimezone(): DateTimeZone
|
||||
public function getTimezone(): \DateTimeZone
|
||||
{
|
||||
return $this->innerDateTime->getTimezone();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user