| 1 | <?php |
||
| 29 | abstract class Event |
||
| 30 | { |
||
| 31 | /** |
||
| 32 | * @var object The source of the event |
||
| 33 | */ |
||
| 34 | private $source; |
||
| 35 | /** |
||
| 36 | * @var float The microtime when the event kicked off |
||
| 37 | */ |
||
| 38 | private $when; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Creates a new event |
||
| 42 | * |
||
| 43 | * @param object $source The source of the event. Cannot be null. |
||
| 44 | */ |
||
| 45 | 3 | public function __construct($source) |
|
| 53 | |||
| 54 | /** |
||
| 55 | * Gets the source of the event. |
||
| 56 | * |
||
| 57 | * @return object The source of the event |
||
| 58 | */ |
||
| 59 | 1 | public function getSource() |
|
| 63 | |||
| 64 | /** |
||
| 65 | * Gets the time in microseconds when the event kicked off. |
||
| 66 | * |
||
| 67 | * @return float The time of the event |
||
| 68 | */ |
||
| 69 | 1 | public function getWhen(): float |
|
| 73 | } |
||
| 74 |