hotfix = $hotfix; $this->facts = $facts; } public function apply() { $stub = file_get_contents(__DIR__.self::PHP_STUB); $body = $this->hotfix->getBody(); $hash = $this->hotfix->getHash(); $stub.= 'function fact($key) { '; $stub.= 'switch ($key) {'; $facts = $this->facts->getFlat(); foreach ($facts as $key=>$value) { $stub.= 'case "'.$key.'": return "'.$value.'";'; } $stub.= '}}'.PHP_EOL; // Create temporary filename based on the hash of the hotfix filename $tmpfile = sys_get_temp_dir()."/hotfix_".$hash; file_put_contents($tmpfile, '