WrapperClock
in package
implements
ClockInterface
FinalYes
Table of Contents
Interfaces
- ClockInterface
Properties
- $currentClock : ClockInterface|Factory|DateTimeInterface
Methods
- __construct() : mixed
- getFactory() : Factory
- now() : DateTimeImmutable
- nowAs() : T
- nowAsCarbon() : CarbonInterface
- sleep() : void
- unwrap() : ClockInterface|Factory|DateTimeInterface
- withTimeZone() : static
- addSeconds() : DateTimeInterface
- dateAsCarbon() : CarbonInterface
- nowRaw() : DateTimeInterface
Properties
$currentClock
private
ClockInterface|Factory|DateTimeInterface
$currentClock
Methods
__construct()
public
__construct(ClockInterface|Factory|DateTimeInterface $currentClock) : mixed
Parameters
- $currentClock : ClockInterface|Factory|DateTimeInterface
getFactory()
public
getFactory() : Factory
Return values
Factorynow()
public
now() : DateTimeImmutable
Return values
DateTimeImmutablenowAs()
public
nowAs(T> $class[, DateTimeZone|string|int|null $timezone = null ]) : T
Parameters
- $class : T>
- $timezone : DateTimeZone|string|int|null = null
Tags
Return values
TnowAsCarbon()
public
nowAsCarbon([DateTimeZone|string|int|null $timezone = null ]) : CarbonInterface
Parameters
- $timezone : DateTimeZone|string|int|null = null
Return values
CarbonInterfacesleep()
public
sleep(float|int $seconds) : void
Parameters
- $seconds : float|int
unwrap()
public
unwrap() : ClockInterface|Factory|DateTimeInterface
Return values
ClockInterface|Factory|DateTimeInterfacewithTimeZone()
public
withTimeZone(DateTimeZone|string $timezone) : static
Parameters
- $timezone : DateTimeZone|string
Return values
staticaddSeconds()
private
addSeconds(DateTimeInterface $date, float|int $seconds) : DateTimeInterface
Parameters
- $date : DateTimeInterface
- $seconds : float|int
Return values
DateTimeInterfacedateAsCarbon()
private
dateAsCarbon(DateTimeInterface $date, DateTimeZone|string|int|null $timezone) : CarbonInterface
Parameters
- $date : DateTimeInterface
- $timezone : DateTimeZone|string|int|null
Return values
CarbonInterfacenowRaw()
private
nowRaw() : DateTimeInterface