| 1 | <?php |
||
| 14 | class Same { |
||
| 15 | /** |
||
| 16 | * Start time. |
||
| 17 | * |
||
| 18 | * @var int |
||
| 19 | */ |
||
| 20 | public $s; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Access time. |
||
| 24 | * |
||
| 25 | * @var int |
||
| 26 | */ |
||
| 27 | public $a; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Modification time. |
||
| 31 | * |
||
| 32 | * @var int |
||
| 33 | */ |
||
| 34 | public $m; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * End time. |
||
| 38 | * |
||
| 39 | * @var int |
||
| 40 | */ |
||
| 41 | public $e; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Constructor |
||
| 45 | * |
||
| 46 | * S.A.M. default to current time, but E defaults to NULL. |
||
| 47 | * |
||
| 48 | * @param int $s |
||
| 49 | * @param int $a |
||
| 50 | * @param int $m |
||
| 51 | * @param int $e |
||
| 52 | */ |
||
| 53 | function __construct($s = NULL, $a = NULL, $m = NULL, $e = NULL) { |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Update the access time. |
||
| 62 | * |
||
| 63 | * @param int $now |
||
| 64 | */ |
||
| 65 | public function access($now = NULL) { |
||
| 68 | |||
| 69 | /** |
||
| 70 | * Update the modification time. |
||
| 71 | * |
||
| 72 | * @param int $now |
||
| 73 | */ |
||
| 74 | public function modify($now = NULL) { |
||
| 81 | |||
| 82 | /** |
||
| 83 | * Update the end time. |
||
| 84 | * |
||
| 85 | * @param int $now |
||
| 86 | */ |
||
| 87 | public function end($now = NULL) { |
||
| 94 | } |
||
| 95 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.