Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
frozen_clock Class Reference
Inheritance diagram for frozen_clock:
core\clock Psr\Clock\ClockInterface

Public Member Functions

 __construct (?int $time=null,)
 Create a new instance of the frozen clock.
 
 bump (int $seconds=1)
 Bump the time by a number of seconds.
 
 now ()
 
 set_to (int $time)
 Set the time of the clock.
 
 time ()
 Return the unix time stamp for the current representation of the time.
 

Public Attributes

DateTimeImmutable DateTimeImmutable $time
 The next time of the clock.
 

Constructor & Destructor Documentation

◆ __construct()

frozen_clock::__construct ( ?int $time = null)

Create a new instance of the frozen clock.

Parameters
null | int$timeThe initial time to use. If not specified, the current time is used.

Member Function Documentation

◆ bump()

frozen_clock::bump ( int $seconds = 1)

Bump the time by a number of seconds.

Parameters
int$seconds

◆ now()

frozen_clock::now ( )

◆ set_to()

frozen_clock::set_to ( int $time)

Set the time of the clock.

Parameters
int$time

◆ time()

frozen_clock::time ( )

Return the unix time stamp for the current representation of the time.

Return values
int

Implements core\clock.


The documentation for this class was generated from the following file: