$timezone =
$this->now->
getTimezone();
$this->now = DatePoint::
createFromInterface(new \
DateTimeImmutable($now,
$timezone))->
setTimezone($timezone);
} /**
* @throws \DateMalformedStringException When $modifier is invalid
*/
public function modify(string
$modifier): void
{ if (\PHP_VERSION_ID < 80300
) { $this->now = @
$this->now->
modify($modifier) ?:
throw new \
DateMalformedStringException(error_get_last()['message'
] ??
sprintf('Invalid modifier: "%s". Could not modify MockClock.',
$modifier));
return;
} $this->now =
$this->now->
modify($modifier);
} /**
* @throws \DateInvalidTimeZoneException When the timezone name is invalid
*/
public function withTimeZone(\DateTimeZone|string
$timezone):
static {