1 | <?php |
||
19 | trait AliasProvider |
||
20 | { |
||
21 | /** |
||
22 | * @var int |
||
23 | */ |
||
24 | protected static $lastQueryId = 0; |
||
25 | |||
26 | /** |
||
27 | * @var string|null |
||
28 | */ |
||
29 | protected $alias; |
||
30 | |||
31 | /** |
||
32 | * @return string|null |
||
33 | */ |
||
34 | 32 | public function getAlias(): ?string |
|
44 | |||
45 | /** |
||
46 | * @param string|null $pattern |
||
47 | * @return string |
||
48 | */ |
||
49 | 32 | private function createAlias(string $pattern = null): string |
|
57 | |||
58 | /** |
||
59 | * @param string|null $pattern |
||
60 | * @return string |
||
61 | */ |
||
62 | 8 | public function placeholder(string $pattern = null): string |
|
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: