1 | <?php |
||
9 | trait Replacer |
||
10 | { |
||
11 | /** |
||
12 | * Replace given string with default replacements and optionally user given |
||
13 | * |
||
14 | * @param string $string |
||
15 | * @param Module $module |
||
16 | * @param array $replacements |
||
17 | * |
||
18 | * @return string |
||
19 | */ |
||
20 | protected function replace($string, Module $module, array $replacements = []) |
||
27 | |||
28 | /** |
||
29 | * Get replacement array that will be used for replace in string |
||
30 | * |
||
31 | * @param Module $module |
||
32 | * @param array $definedReplacements |
||
33 | * |
||
34 | * @return Collection |
||
35 | */ |
||
36 | private function getReplacements(Module $module, array $definedReplacements) |
||
54 | |||
55 | /** |
||
56 | * Get config class instance |
||
57 | * |
||
58 | * @return Config |
||
59 | */ |
||
60 | private function configClass() |
||
64 | } |
||
65 |
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: