Passed
Push — master ( f9f734...3d8280 )
by Tobias
02:21
created
src/WrkLst/DocxMustache/DocxMustache.php 2 patches
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -137,8 +137,9 @@  discard block
 block discarded – undo
137 137
     protected function MustacheRender($items, $mustache_template)
138 138
     {
139 139
         $m = new \Mustache_Engine(array('escape' => function($value) {
140
-            if (str_replace('*[[DONOTESCAPE]]*', '', $value) != $value)
141
-                return str_replace('*[[DONOTESCAPE]]*', '', $value);
140
+            if (str_replace('*[[DONOTESCAPE]]*', '', $value) != $value) {
141
+                            return str_replace('*[[DONOTESCAPE]]*', '', $value);
142
+            }
142 143
             return htmlspecialchars($value, ENT_COMPAT, 'UTF-8');
143 144
         }));
144 145
         return $m->render($mustache_template, $items);
@@ -163,8 +164,9 @@  discard block
 block discarded – undo
163 164
         $jpeg_already_set = false;
164 165
         foreach ($ct_file as $ct)
165 166
         {
166
-            if ((string) $ct_file->Default[$i]['Extension'] == "jpeg")
167
-                $jpeg_already_set = true;
167
+            if ((string) $ct_file->Default[$i]['Extension'] == "jpeg") {
168
+                            $jpeg_already_set = true;
169
+            }
168 170
             $i++;
169 171
         }
170 172
 
@@ -293,10 +295,11 @@  discard block
 block discarded – undo
293 295
                     $img_rework = \Image::make($this->storagePath($this->local_path.'word/media/'.$imgs[$k]['img_file_src']));
294 296
                     $w = $img['width'];
295 297
                     $h = $img['height'];
296
-                    if ($w > $h)
297
-                        $h = null;
298
-                    else
299
-                        $w = null;
298
+                    if ($w > $h) {
299
+                                            $h = null;
300
+                    } else {
301
+                                            $w = null;
302
+                    }
300 303
                     $img_rework->resize($w, $h, function($constraint) {
301 304
                         $constraint->aspectRatio();
302 305
                         $constraint->upsize();
Please login to merge, or discard this patch.
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -119,12 +119,19 @@
 block discarded – undo
119 119
         }
120 120
     }
121 121
 
122
+    /**
123
+     * @param string $content
124
+     */
122 125
     protected function MustacheTagCleaner($content)
123 126
     {
124 127
         //kills all xml tags within curly mustache brackets
125 128
         //this is necessary, as word might produce unnecesary xml tage inbetween curly backets.
126 129
         return preg_replace_callback(
127 130
             '/{{(.*?)}}/',
131
+
132
+            /**
133
+             * @param string $treffer
134
+             */
128 135
             function($treffer) {
129 136
                 return strip_tags($treffer[0]);
130 137
             },
Please login to merge, or discard this patch.