| 1 | <?php |
||
| 5 | trait LegacyTemplateTrait |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @param int $menu |
||
| 9 | * |
||
| 10 | * @return void |
||
| 11 | */ |
||
| 12 | protected function setMenu($menu) |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @param string $title |
||
| 19 | * |
||
| 20 | * @return void |
||
| 21 | */ |
||
| 22 | protected function setTitle($title) |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param string $url |
||
| 29 | * |
||
| 30 | * @return void |
||
| 31 | */ |
||
| 32 | protected function setTarget($url) |
||
| 36 | } |
||
| 37 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: