Passed
Push — master ( 65fd56...e1970b )
by Tobias
02:40
created
src/WrkLst/DocxMustache/DocxMustache.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -408,10 +408,10 @@  discard block
 block discarded – undo
408 408
             $value_array[] = $tag_open_values[0];
409 409
         }
410 410
 
411
-        $value = implode('',$value_array);
411
+        $value = implode('', $value_array);
412 412
 
413
-        if($run_again) {
414
-                    $value = $this->convertHtmlToOpenXMLTag($value,$tag);
413
+        if ($run_again) {
414
+                    $value = $this->convertHtmlToOpenXMLTag($value, $tag);
415 415
         }
416 416
 
417 417
         return $value;
@@ -422,9 +422,9 @@  discard block
 block discarded – undo
422 422
      */
423 423
     protected function convertHtmlToOpenXML($value)
424 424
     {
425
-        $line_breaks = array("<br />","<br/>","<br>");
426
-        $line_breaks = array("<br />","<br/>","<br>");
427
-        $value = str_replace($line_breaks,'<w:br/>',$value);
425
+        $line_breaks = array("&lt;br /&gt;", "&lt;br/&gt;", "&lt;br&gt;");
426
+        $line_breaks = array("<br />", "<br/>", "<br>");
427
+        $value = str_replace($line_breaks, '<w:br/>', $value);
428 428
 
429 429
         $value = $this->convertHtmlToOpenXMLTag($value, "b");
430 430
         $value = $this->convertHtmlToOpenXMLTag($value, "i");
Please login to merge, or discard this patch.
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.