Passed
Push — 1.10.x ( f64eef...04397c )
by Angel Fernando Quiroz
132:38 queued 79:40
created
main/inc/lib/phpdocx/pdf/include/image_frame_reflower.cls.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -144,7 +144,9 @@
 block discarded – undo
144 144
       }
145 145
     }
146 146
 
147
-    if (DEBUGPNG) print $width.' '.$height.';';
147
+    if (DEBUGPNG) {
148
+        print $width.' '.$height.';';
149
+    }
148 150
 
149 151
     // Synchronize the styles
150 152
     $inner_style = $this->_frame->get_style();
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/include/canvas_factory.cls.php 1 patch
Braces   +14 added lines, -18 removed lines patch added patch discarded remove patch
@@ -58,24 +58,20 @@
 block discarded – undo
58 58
 
59 59
     $backend = strtolower(DOMPDF_PDF_BACKEND);
60 60
     
61
-    if ( isset($class) && class_exists($class, false) )
62
-      $class .= "_Adapter";
63
-    
64
-    else if ( (DOMPDF_PDF_BACKEND === "auto" || $backend === "pdflib" ) &&
65
-              class_exists("PDFLib", false) )
66
-      $class = "PDFLib_Adapter";
67
-
68
-    else if ( (DOMPDF_PDF_BACKEND === "auto" || $backend === "cpdf") )
69
-      $class = "CPDF_Adapter";
70
-
71
-    else if ( ( $backend === "tcpdf") )
72
-      $class = "TCPDF_Adapter";
73
-      
74
-    else if ( $backend === "gd" )
75
-      $class = "GD_Adapter";
76
-    
77
-    else
78
-      $class = "CPDF_Adapter";
61
+    if ( isset($class) && class_exists($class, false) ) {
62
+          $class .= "_Adapter";
63
+    } else if ( (DOMPDF_PDF_BACKEND === "auto" || $backend === "pdflib" ) &&
64
+              class_exists("PDFLib", false) ) {
65
+          $class = "PDFLib_Adapter";
66
+    } else if ( (DOMPDF_PDF_BACKEND === "auto" || $backend === "cpdf") ) {
67
+          $class = "CPDF_Adapter";
68
+    } else if ( ( $backend === "tcpdf") ) {
69
+          $class = "TCPDF_Adapter";
70
+    } else if ( $backend === "gd" ) {
71
+          $class = "GD_Adapter";
72
+    } else {
73
+          $class = "CPDF_Adapter";
74
+    }
79 75
 
80 76
     return new $class($paper, $orientation);
81 77
         
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/include/font_metrics.cls.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -216,13 +216,15 @@
 block discarded – undo
216 216
    * @see save_font_families()
217 217
    */
218 218
   static function load_font_families() {
219
-    if ( !is_readable(self::CACHE_FILE) )
220
-      return;
219
+    if ( !is_readable(self::CACHE_FILE) ) {
220
+          return;
221
+    }
221 222
 
222 223
     $data = file_get_contents(self::CACHE_FILE);
223 224
 
224
-    if ( $data != "" )
225
-      eval ('self::$_font_lookup = ' . $data . ";");
225
+    if ( $data != "" ) {
226
+          eval ('self::$_font_lookup = ' . $data . ";");
227
+    }
226 228
   }
227 229
 
228 230
   /**
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/include/block_renderer.cls.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,8 +58,9 @@  discard block
 block discarded – undo
58 58
       $this->_canvas->filled_rectangle( $x, $y, $w, $h, $style->background_color );
59 59
     }
60 60
 
61
-    if ( ($url = $style->background_image) && $url !== "none" )
62
-      $this->_background_image($url, $x, $y, $w, $h, $style);
61
+    if ( ($url = $style->background_image) && $url !== "none" ) {
62
+          $this->_background_image($url, $x, $y, $w, $h, $style);
63
+    }
63 64
 
64 65
 
65 66
     $this->_render_border($frame);
@@ -81,8 +82,9 @@  discard block
 block discarded – undo
81 82
     foreach ($bp as $side => $props) {
82 83
       list($x, $y, $w, $h) = $bbox;
83 84
 
84
-      if ( !$props["style"] || $props["style"] === "none" || $props["width"] <= 0 )
85
-        continue;
85
+      if ( !$props["style"] || $props["style"] === "none" || $props["width"] <= 0 ) {
86
+              continue;
87
+      }
86 88
 
87 89
 
88 90
       switch($side) {
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/include/inline_frame_decorator.cls.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,8 +62,9 @@
 block discarded – undo
62 62
       return;
63 63
     }
64 64
     
65
-    if ( $frame->get_parent() !== $this )
66
-      throw new DOMPDF_Exception("Unable to split: frame is not a child of this one.");
65
+    if ( $frame->get_parent() !== $this ) {
66
+          throw new DOMPDF_Exception("Unable to split: frame is not a child of this one.");
67
+    }
67 68
         
68 69
     $split = $this->copy( $this->_frame->get_node()->cloneNode() ); 
69 70
     $this->get_parent()->insert_child_after($split, $this);
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/include/renderer.cls.php 1 patch
Braces   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -100,10 +100,11 @@  discard block
 block discarded – undo
100 100
       break;
101 101
 
102 102
     case "inline":
103
-      if ( $frame->get_node()->nodeName === "#text" )
104
-        $this->_render_frame("text", $frame);
105
-      else
106
-        $this->_render_frame("inline", $frame);
103
+      if ( $frame->get_node()->nodeName === "#text" ) {
104
+              $this->_render_frame("text", $frame);
105
+      } else {
106
+              $this->_render_frame("inline", $frame);
107
+      }
107 108
       break;
108 109
 
109 110
     case "table-cell":
@@ -126,9 +127,7 @@  discard block
 block discarded – undo
126 127
              $node->getAttribute("language") === "php" ) {
127 128
           // Evaluate embedded php scripts
128 129
           $this->_render_frame("php", $frame);
129
-        }
130
-        
131
-        elseif ( $node->getAttribute("type") === "text/javascript" ||
130
+        } elseif ( $node->getAttribute("type") === "text/javascript" ||
132 131
              $node->getAttribute("language") === "javascript" ) {
133 132
           // Insert JavaScript
134 133
           $this->_render_frame("javascript", $frame);
@@ -146,8 +145,9 @@  discard block
 block discarded – undo
146 145
     // Check for begin frame callback
147 146
     $this->_check_callbacks("begin_frame", $frame);
148 147
     
149
-    foreach ($frame->get_children() as $child)
150
-      $this->render($child);
148
+    foreach ($frame->get_children() as $child) {
149
+          $this->render($child);
150
+    }
151 151
 
152 152
     // Check for end frame callback
153 153
     $this->_check_callbacks("end_frame", $frame);
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/include/inline_renderer.cls.php 1 patch
Braces   +27 added lines, -18 removed lines patch added patch discarded remove patch
@@ -52,8 +52,10 @@  discard block
 block discarded – undo
52 52
   function render(Frame $frame) {
53 53
     $style = $frame->get_style();
54 54
 
55
-    if ( !$frame->get_first_child() )
56
-      return; // No children, no service
55
+    if ( !$frame->get_first_child() ) {
56
+          return;
57
+    }
58
+    // No children, no service
57 59
     
58 60
     // Draw the left border if applicable
59 61
     $bp = $style->get_border_properties();
@@ -87,8 +89,9 @@  discard block
 block discarded – undo
87 89
         // borders on this line.
88 90
 
89 91
         // Background:
90
-        if ( ($bg = $style->background_color) !== "transparent" )
91
-          $this->_canvas->filled_rectangle( $x, $y, $w, $h, $style->background_color);
92
+        if ( ($bg = $style->background_color) !== "transparent" ) {
93
+                  $this->_canvas->filled_rectangle( $x, $y, $w, $h, $style->background_color);
94
+        }
92 95
 
93 96
         if ( ($url = $style->background_image) && $url !== "none" ) {
94 97
           $this->_background_image($url, $x, $y, $w, $h, $style);
@@ -118,8 +121,9 @@  discard block
 block discarded – undo
118 121
         // Handle anchors & links
119 122
         if ( $frame->get_node()->nodeName === "a" ) {
120 123
                     
121
-          if ( $href = $frame->get_node()->getAttribute("href") )
122
-            $this->_canvas->add_link($href, $x, $y, $w, $h);
124
+          if ( $href = $frame->get_node()->getAttribute("href") ) {
125
+                      $this->_canvas->add_link($href, $x, $y, $w, $h);
126
+          }
123 127
 
124 128
         }
125 129
 
@@ -130,18 +134,20 @@  discard block
 block discarded – undo
130 134
         continue;
131 135
       }
132 136
 
133
-      if ( is_null($w) )
134
-        $w = $child_w;
135
-      else
136
-        $w += $child_w;
137
+      if ( is_null($w) ) {
138
+              $w = $child_w;
139
+      } else {
140
+              $w += $child_w;
141
+      }
137 142
       
138 143
       $h = max($h, $child_h);
139 144
     }
140 145
 
141 146
     
142 147
     // Handle the last child
143
-    if ( ($bg = $style->background_color) !== "transparent" ) 
144
-      $this->_canvas->filled_rectangle( $x + $widths[3], $y + $widths[0], $w, $h, $style->background_color);
148
+    if ( ($bg = $style->background_color) !== "transparent" ) {
149
+          $this->_canvas->filled_rectangle( $x + $widths[3], $y + $widths[0], $w, $h, $style->background_color);
150
+    }
145 151
 
146 152
     //On continuation lines (after line break) of inline elements, the style got copied.
147 153
     //But a non repeatable background image should not be repeated on the next line.
@@ -151,8 +157,9 @@  discard block
 block discarded – undo
151 157
     // Repeat not given: default is Style::__construct
152 158
     // ... && (!($repeat = $style->background_repeat) || $repeat === "repeat" ...
153 159
     //different position? $this->_background_image($url, $x, $y, $w, $h, $style);
154
-    if ( ($url = $style->background_image) && $url !== "none" )           
155
-      $this->_background_image($url, $x + $widths[3], $y + $widths[0], $w, $h, $style);
160
+    if ( ($url = $style->background_image) && $url !== "none" ) {
161
+          $this->_background_image($url, $x + $widths[3], $y + $widths[0], $w, $h, $style);
162
+    }
156 163
         
157 164
     // Add the border widths
158 165
     $w += $widths[1] + $widths[3];
@@ -190,11 +197,13 @@  discard block
 block discarded – undo
190 197
     // Handle anchors & links
191 198
     if ( $frame->get_node()->nodeName === "a" ) {
192 199
 
193
-      if ( $name = $frame->get_node()->getAttribute("name") )
194
-        $this->_canvas->add_named_dest($name);
200
+      if ( $name = $frame->get_node()->getAttribute("name") ) {
201
+              $this->_canvas->add_named_dest($name);
202
+      }
195 203
 
196
-      if ( $href = $frame->get_node()->getAttribute("href") )
197
-        $this->_canvas->add_link($href, $x, $y, $w, $h);
204
+      if ( $href = $frame->get_node()->getAttribute("href") ) {
205
+              $this->_canvas->add_link($href, $x, $y, $w, $h);
206
+      }
198 207
     }
199 208
   }
200 209
 }
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/include/list_bullet_image_frame_decorator.cls.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -146,8 +146,9 @@
 block discarded – undo
146 146
     // Small hack to prevent indenting of list text
147 147
     // Image Might not exist, then position like on list_bullet_frame_decorator fallback to none. 
148 148
     if ( $this->_frame->get_style()->list_style_position === "outside" ||
149
-         $this->_width == 0) 
150
-      return 0;
149
+         $this->_width == 0) {
150
+          return 0;
151
+    }
151 152
     //This aligns the "inside" image position with the text.
152 153
     //The text starts to the right of the image.
153 154
     //Between the image and the text there is an added margin of image width.
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/include/frame_factory.cls.php 1 patch
Braces   +17 added lines, -13 removed lines patch added patch discarded remove patch
@@ -61,8 +61,9 @@  discard block
 block discarded – undo
61 61
 
62 62
   // FIXME: this is admittedly a little smelly...
63 63
   static function decorate_frame(Frame $frame, $dompdf) {
64
-    if ( is_null($dompdf) )
65
-      throw new Exception("foo");
64
+    if ( is_null($dompdf) ) {
65
+          throw new Exception("foo");
66
+    }
66 67
     switch ($frame->get_style()->display) {
67 68
       
68 69
     case "block":
@@ -127,15 +128,17 @@  discard block
 block discarded – undo
127 128
       break;
128 129
 
129 130
     case "-dompdf-list-bullet":
130
-      if ( $frame->get_style()->list_style_position === "inside" )
131
-        $positioner = "Inline";
132
-      else        
133
-        $positioner = "List_Bullet";
134
-
135
-      if ( $frame->get_style()->list_style_image !== "none" )
136
-        $decorator = "List_Bullet_Image";
137
-      else
138
-        $decorator = "List_Bullet";
131
+      if ( $frame->get_style()->list_style_position === "inside" ) {
132
+              $positioner = "Inline";
133
+      } else {
134
+              $positioner = "List_Bullet";
135
+      }
136
+
137
+      if ( $frame->get_style()->list_style_image !== "none" ) {
138
+              $decorator = "List_Bullet_Image";
139
+      } else {
140
+              $decorator = "List_Bullet";
141
+      }
139 142
       
140 143
       $reflower = "List_Bullet";
141 144
       break;
@@ -163,8 +166,9 @@  discard block
 block discarded – undo
163 166
     }
164 167
 
165 168
     if ( $frame->get_style()->position === "absolute" ||
166
-         $frame->get_style()->position === "fixed" )
167
-      $positioner = "Absolute";
169
+         $frame->get_style()->position === "fixed" ) {
170
+          $positioner = "Absolute";
171
+    }
168 172
     
169 173
     $positioner .= "_Positioner";
170 174
     $decorator .= "_Frame_Decorator";
Please login to merge, or discard this patch.