1 | <?php |
||
15 | class setup |
||
16 | { |
||
17 | /** @var \phpbb\auth\auth */ |
||
18 | protected $auth; |
||
19 | |||
20 | /** @var \phpbb\config\config */ |
||
21 | protected $config; |
||
22 | |||
23 | /** @var \phpbb\template\template */ |
||
24 | protected $template; |
||
25 | |||
26 | /** |
||
27 | * Constructor |
||
28 | * |
||
29 | * @param \phpbb\auth\auth $auth Auth object |
||
30 | * @param \phpbb\config\config $config Config object |
||
31 | * @param \phpbb\template\template $template Template object |
||
32 | */ |
||
33 | 12 | public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\template\template $template) |
|
39 | |||
40 | /** |
||
41 | * @return bool |
||
42 | */ |
||
43 | 4 | public function is_enabled() |
|
47 | |||
48 | /** |
||
49 | * @return void |
||
50 | */ |
||
51 | 4 | public function get_access_key() |
|
55 | |||
56 | /** |
||
57 | * @return array |
||
58 | */ |
||
59 | 4 | public function set_js_vars() |
|
66 | } |
||
67 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: