1 | <?php |
||
26 | trait TransformerTrait |
||
27 | { |
||
28 | |||
29 | /** |
||
30 | * Makes it so the content is available in getenv() |
||
31 | */ |
||
32 | 1 | public function toEnv(){ |
|
40 | |||
41 | /** |
||
42 | * Converts the array into a flat dot notation array |
||
43 | * |
||
44 | * @return array The dot notation array |
||
45 | */ |
||
46 | 1 | public function toDots() |
|
50 | |||
51 | /** |
||
52 | * Converts the array into a flat dot notation array |
||
53 | * |
||
54 | * @param array $content The content array |
||
55 | * @param string $prefix The prefix for the key |
||
56 | * |
||
57 | * @return array The dot notation array |
||
58 | */ |
||
59 | 1 | private function dotTransformer($content, $prefix = '') |
|
73 | |||
74 | } |
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: