1 | <?php |
||
9 | trait HasConfig |
||
10 | { |
||
11 | |||
12 | protected function tokenType(): string |
||
16 | |||
17 | protected function tokenLength(): int |
||
21 | |||
22 | protected function timeout(): ?int |
||
26 | |||
27 | protected function customSet(): ?string |
||
31 | |||
32 | protected function shouldHash(): bool |
||
36 | |||
37 | protected function sensitiveCase() |
||
41 | |||
42 | protected function getConfig(string $key, $default) |
||
48 | |||
49 | } |
||
50 |
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: