1 | <?php |
||
26 | trait TransformerTrait |
||
27 | { |
||
28 | /** |
||
29 | * Makes it so the content is available in getenv() |
||
30 | */ |
||
31 | 1 | public function toEnv() |
|
41 | |||
42 | /** |
||
43 | * Converts the array into a flat dot notation array |
||
44 | * |
||
45 | * @param bool $flatten_array Flatten arrays into none existent keys |
||
46 | * |
||
47 | * @return array The dot notation array |
||
48 | */ |
||
49 | 2 | public function toDots($flatten_array = true) |
|
53 | |||
54 | /** |
||
55 | * Converts the array into a flat dot notation array |
||
56 | * |
||
57 | * @param array $content The content array |
||
58 | * @param bool $flatten_array Flatten arrays into none existent keys |
||
59 | * @param string $prefix The prefix for the key |
||
60 | * |
||
61 | * @return array The dot notation array |
||
62 | */ |
||
63 | 2 | private function dotTransformer($content, $flatten_array, $prefix = '') |
|
80 | } |
||
81 |
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: