| 1 | <?php |
||
| 3 | trait Time { |
||
| 4 | |||
| 5 | /** |
||
| 6 | * Convert timestamp to HTTP-date (RFC2616) |
||
| 7 | * |
||
| 8 | * For use in "Last-Modified" headers. |
||
| 9 | * |
||
| 10 | * @param string $timestamp |
||
| 11 | * @return string |
||
|
|
|||
| 12 | */ |
||
| 13 | public static function timestampToHttpDate($timestamp) { |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Convert timestamp to x unit(plural), like "6 minutes" or "1 day". |
||
| 20 | * |
||
| 21 | * @param string $timestamp |
||
| 22 | * @param int $limit Limit in seconds when to return nothing |
||
| 23 | * @return string Formated time: "x unit(s)" or empty string |
||
| 24 | */ |
||
| 25 | public static function timeElapsed($timestamp) { |
||
| 50 | |||
| 51 | } |
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.