Conditions | 5 |
Paths | 2 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function generate() { |
||
18 | //Open template file |
||
19 | $configTemplate = file_get_contents($this->sourceFile); |
||
20 | $result = false; |
||
21 | if($configTemplate && is_array($this->replaces) && count($this->replaces)) { |
||
22 | foreach($this->replaces as $key => $value) { |
||
23 | //Replace Host user |
||
24 | $configTemplate = str_replace($key, $value, $configTemplate); |
||
25 | } |
||
26 | $result = (file_put_contents($this->destinationFile, $configTemplate) > 0); |
||
27 | } |
||
28 | return $result; |
||
29 | } |
||
30 | } |
||
32 | ?> |
||
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.