1 | <?php |
||
17 | class birthday extends block |
||
18 | { |
||
19 | /** @var \phpbb\cache\driver\driver_interface */ |
||
20 | protected $cache; |
||
21 | |||
22 | /** @var \phpbb\db\driver\driver_interface */ |
||
23 | protected $db; |
||
24 | |||
25 | /** @var \phpbb\user */ |
||
26 | protected $user; |
||
27 | |||
28 | /** @var string */ |
||
29 | protected $time; |
||
30 | |||
31 | /** |
||
32 | * Constructor |
||
33 | * |
||
34 | * @param \phpbb\cache\driver\driver_interface $cache Cache driver interface |
||
35 | * @param \phpbb\db\driver\driver_interface $db Database connection |
||
36 | * @param \phpbb\user $user User object |
||
37 | * @param string $time String in a format accepted by strtotime(). |
||
38 | */ |
||
39 | 4 | public function __construct(\phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\user $user, $time = 'now') |
|
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | */ |
||
50 | 3 | public function display(array $bdata, $edit_mode = false) |
|
69 | |||
70 | /** |
||
71 | * @return bool |
||
72 | */ |
||
73 | 3 | private function find_birthday_users() |
|
103 | |||
104 | /** |
||
105 | * Display birthdays of 29th february on 28th february in non-leap-years |
||
106 | * |
||
107 | * @param array $now |
||
108 | * @param \phpbb\datetime $time |
||
109 | * @return string |
||
110 | */ |
||
111 | 3 | private function adjust_leap_year(array $now, \phpbb\datetime $time) |
|
121 | |||
122 | /** |
||
123 | * @param string $user_birthday |
||
124 | * @param int $year |
||
125 | * @return string |
||
126 | */ |
||
127 | 2 | private function get_user_age($user_birthday, $year) |
|
132 | } |
||
133 |