Passed
Push — master ( fa68f7...dc9099 )
by Peter
08:47
created
src/PhpOutlookSignature.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@  discard block
 block discarded – undo
7 7
 class PhpOutlookSignature
8 8
 {
9 9
     private string $default_template = '';
10
-    private string $template_folder = '';    //<template>
11
-    private string $template_file = '';      //<template>/<message>.htm
12
-    private string $assets_folder = '';      //<template>/<message>_files/
13
-    private string $assets_local = '';       //<message>_files
10
+    private string $template_folder = ''; //<template>
11
+    private string $template_file = ''; //<template>/<message>.htm
12
+    private string $assets_folder = ''; //<template>/<message>_files/
13
+    private string $assets_local = ''; //<message>_files
14 14
     private array $keywords = [];
15 15
     private array $included_files = [];
16 16
     private bool $is_ready = false;
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         }
31 31
         $this->template_folder = $folder;
32 32
         $this->check_template_files($this->template_folder);
33
-        if (!file_exists($this->assets_folder."/filelist.xml")) {
33
+        if (!file_exists($this->assets_folder . "/filelist.xml")) {
34 34
             $this->create_filelist();
35 35
         }
36 36
         $this->analyze_template_text();
@@ -69,16 +69,16 @@  discard block
 block discarded – undo
69 69
             $copy_file = "$assets_folder/" . basename($file);
70 70
             copy($file, $copy_file);
71 71
         }
72
-        $this->prepare_script($this->template_folder.'/install_windows.cmd',$output_folder,'%APPDATA%\Microsoft\Signatures');
72
+        $this->prepare_script($this->template_folder . '/install_windows.cmd', $output_folder, '%APPDATA%\Microsoft\Signatures');
73 73
         // TODO: install script for MacOS
74 74
         return true;
75 75
     }
76 76
 
77 77
     // ---------------------------- PRIVATE METHODS
78 78
 
79
-    private function prepare_script($input_file,$output_folder,$destination){
80
-        if(!file_exists($input_file)) return false;
81
-        $install_script = $output_folder."/".basename($input_file);
79
+    private function prepare_script($input_file, $output_folder, $destination) {
80
+        if (!file_exists($input_file)) return false;
81
+        $install_script = $output_folder . "/" . basename($input_file);
82 82
         $script = file_get_contents($input_file);
83 83
         $script = str_replace('{destin}', $destination, $script);
84 84
         file_put_contents($install_script, $script);
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         $this->keywords = [];
114 114
         $this->included_files = [];
115 115
         $text = file_get_contents($this->template_file);
116
-        $text = str_replace($this->assets_local.'/', '{assets}/', $text);
116
+        $text = str_replace($this->assets_local . '/', '{assets}/', $text);
117 117
         preg_match_all('|\{(\w+)\}|', $text, $matches, PREG_SET_ORDER);
118 118
         foreach ($matches as $match) {
119 119
             $keyword = $match[1];
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,9 @@
 block discarded – undo
77 77
     // ---------------------------- PRIVATE METHODS
78 78
 
79 79
     private function prepare_script($input_file,$output_folder,$destination){
80
-        if(!file_exists($input_file)) return false;
80
+        if(!file_exists($input_file)) {
81
+            return false;
82
+        }
81 83
         $install_script = $output_folder."/".basename($input_file);
82 84
         $script = file_get_contents($input_file);
83 85
         $script = str_replace('{destin}', $destination, $script);
Please login to merge, or discard this patch.