1 | <?php |
||
10 | final class Controller |
||
11 | { |
||
12 | |||
13 | /** |
||
14 | * @var string |
||
15 | */ |
||
16 | private $secret; |
||
17 | |||
18 | /** |
||
19 | * @var bool |
||
20 | */ |
||
21 | private $secured = FALSE; |
||
22 | |||
23 | /** |
||
24 | * @var callable[] |
||
25 | */ |
||
26 | private $router; |
||
27 | |||
28 | 4 | public function __construct(ContainerInterface $ci, Handler $handler) |
|
50 | |||
51 | |||
52 | 4 | public function __invoke(Request $request, Response $response, $args) |
|
76 | |||
77 | } |
||
78 |
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: