| Total Complexity | 3 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class format_date extends \Twig\Extension\AbstractExtension |
||
| 13 | { |
||
| 14 | /** @var \phpbb\user */ |
||
| 15 | protected $user; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Constructor |
||
| 19 | * |
||
| 20 | * @param \phpbb\user $user |
||
| 21 | * @return \phpbb\template\twig\extension |
||
| 22 | */ |
||
| 23 | public function __construct(\phpbb\user $user) |
||
| 24 | { |
||
| 25 | $this->user = $user; |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @inheritdoc |
||
| 30 | */ |
||
| 31 | public function getFilters() |
||
| 35 | ]; |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Format user date |
||
| 40 | * |
||
| 41 | * @param int $gmepoch unix timestamp |
||
| 42 | * @param string $format date format in date() notation. | used to indicate relative dates, for example |d m Y|, h:i is translated to Today, h:i. |
||
| 43 | * @param bool $forcedate force non-relative date format. |
||
| 44 | * |
||
| 45 | * @return mixed translated date |
||
| 46 | */ |
||
| 47 | public function format_date_filter($timestamp, $format = false, $forcedate = false) |
||
| 50 | } |
||
| 51 | } |
||
| 52 |