Completed
Push — master ( 6706d8...93737b )
by
unknown
07:43
created
lib/Cpdf.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
     function __construct($pageSize = array(0, 0, 612, 792), $isUnicode = false, $fontcache = '', $tmp = '')
344 344
     {
345 345
         $this->isUnicode = $isUnicode;
346
-        $this->fontcache = rtrim($fontcache, DIRECTORY_SEPARATOR."/\\");
346
+        $this->fontcache = rtrim($fontcache, DIRECTORY_SEPARATOR . "/\\");
347 347
         $this->tmp = ($tmp !== '' ? $tmp : sys_get_temp_dir());
348 348
         $this->newDocument($pageSize);
349 349
 
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
                     if (is_string($v)) {
511 511
                         $v = '/' . $v;
512 512
                     } elseif (is_int($v)) {
513
-                        $v = (string) $v;
513
+                        $v = (string)$v;
514 514
                     } elseif (is_bool($v)) {
515 515
                         $v = ($v ? 'true' : 'false');
516 516
                     } elseif (is_array($v)) {
@@ -1748,7 +1748,7 @@  discard block
 block discarded – undo
1748 1748
                 // make the new object
1749 1749
                 $this->objects[$id] = array('t' => 'image', 'data' => &$options['data'], 'info' => array());
1750 1750
 
1751
-                $info =& $this->objects[$id]['info'];
1751
+                $info = & $this->objects[$id]['info'];
1752 1752
 
1753 1753
                 $info['Type'] = '/XObject';
1754 1754
                 $info['Subtype'] = '/Image';
@@ -2241,7 +2241,7 @@  discard block
 block discarded – undo
2241 2241
         }
2242 2242
 
2243 2243
         if ($this->fileIdentifier === '') {
2244
-            $tmp = implode('',  $this->objects[$this->infoObject]['info']);
2244
+            $tmp = implode('', $this->objects[$this->infoObject]['info']);
2245 2245
             $this->fileIdentifier = md5('DOMPDF' . __FILE__ . $tmp . microtime() . mt_rand());
2246 2246
         }
2247 2247
 
@@ -2346,7 +2346,7 @@  discard block
 block discarded – undo
2346 2346
 
2347 2347
         $fontcache = $this->fontcache;
2348 2348
         if ($fontcache == '') {
2349
-            $fontcache = rtrim($dir, DIRECTORY_SEPARATOR."/\\");
2349
+            $fontcache = rtrim($dir, DIRECTORY_SEPARATOR . "/\\");
2350 2350
         }
2351 2351
 
2352 2352
         //$name       filename without folder and extension of font metrics
Please login to merge, or discard this patch.
src/FontMetrics.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
             $cacheData .= sprintf("  '%s' => array(%s", addslashes($family), PHP_EOL);
98 98
             foreach ($variants as $variant => $path) {
99 99
                 $path = sprintf("'%s'", $path);
100
-                $path = str_replace('\'' . $this->getOptions()->getFontDir() , '$fontDir . \'' , $path);
101
-                $path = str_replace('\'' . $this->getOptions()->getRootDir() , '$rootDir . \'' , $path);
100
+                $path = str_replace('\'' . $this->getOptions()->getFontDir(), '$fontDir . \'', $path);
101
+                $path = str_replace('\'' . $this->getOptions()->getRootDir(), '$rootDir . \'', $path);
102 102
                 $cacheData .= sprintf("    '%s' => %s,%s", $variant, $path, PHP_EOL);
103 103
             }
104 104
             $cacheData .= sprintf("  ),%s", PHP_EOL);
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
         $localTempFile = tempnam($this->options->get("tempDir"), "dompdf-font-");
190 190
 
191 191
         $cacheEntry = $localFile;
192
-        $localFile .= ".".strtolower(pathinfo(parse_url($remoteFile, PHP_URL_PATH),PATHINFO_EXTENSION));
192
+        $localFile .= "." . strtolower(pathinfo(parse_url($remoteFile, PHP_URL_PATH), PATHINFO_EXTENSION));
193 193
 
194 194
         $entry[$styleString] = $cacheEntry;
195 195
 
@@ -213,14 +213,14 @@  discard block
 block discarded – undo
213 213
 
214 214
         unlink($localTempFile);
215 215
 
216
-        if ( !file_exists("$cacheEntry.ufm") ) {
216
+        if (!file_exists("$cacheEntry.ufm")) {
217 217
             return false;
218 218
         }
219 219
 
220 220
         // Save the changes
221 221
         file_put_contents($localFile, $remoteFileContent);
222 222
 
223
-        if ( !file_exists($localFile) ) {
223
+        if (!file_exists($localFile)) {
224 224
             unlink("$cacheEntry.ufm");
225 225
             return false;
226 226
         }
Please login to merge, or discard this patch.
src/FrameReflower/AbstractFrameReflower.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
         // Collapse vertical margins:
95 95
         $n = $frame->get_next_sibling();
96
-        if ( $n && !$n->is_block() & !$n->is_table() ) {
96
+        if ($n && !$n->is_block() & !$n->is_table()) {
97 97
             while ($n = $n->get_next_sibling()) {
98 98
                 if ($n->is_block() || $n->is_table()) {
99 99
                     break;
@@ -116,13 +116,13 @@  discard block
 block discarded – undo
116 116
         // Collapse our first child's margin, if there is no border or padding
117 117
         if ($style->get_border_top_width() == 0 && $style->length_in_pt($style->padding_top) == 0) {
118 118
             $f = $this->_frame->get_first_child();
119
-            if ( $f && !$f->is_block() && !$f->is_table() ) {
120
-                while ( $f = $f->get_next_sibling() ) {
121
-                    if ( $f->is_block() || $f->is_table() ) {
119
+            if ($f && !$f->is_block() && !$f->is_table()) {
120
+                while ($f = $f->get_next_sibling()) {
121
+                    if ($f->is_block() || $f->is_table()) {
122 122
                         break;
123 123
                     }
124 124
 
125
-                    if ( !$f->get_first_child() ) {
125
+                    if (!$f->get_first_child()) {
126 126
                         $f = null;
127 127
                         break;
128 128
                     }
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
             if ($f) {
134 134
                 $f_style = $f->get_style();
135 135
                 $t = max($t, (float)$f_style->length_in_pt($f_style->margin_top, $cb["h"]));
136
-                $style->margin_top = $t."pt";
136
+                $style->margin_top = $t . "pt";
137 137
                 $f_style->margin_top = "0pt";
138 138
             }
139 139
         }
@@ -141,13 +141,13 @@  discard block
 block discarded – undo
141 141
         // Collapse our last child's margin, if there is no border or padding
142 142
         if ($style->get_border_bottom_width() == 0 && $style->length_in_pt($style->padding_bottom) == 0) {
143 143
             $l = $this->_frame->get_last_child();
144
-            if ( $l && !$l->is_block() && !$l->is_table() ) {
145
-                while ( $l = $l->get_prev_sibling() ) {
146
-                    if ( $l->is_block() || $l->is_table() ) {
144
+            if ($l && !$l->is_block() && !$l->is_table()) {
145
+                while ($l = $l->get_prev_sibling()) {
146
+                    if ($l->is_block() || $l->is_table()) {
147 147
                         break;
148 148
                     }
149 149
 
150
-                    if ( !$l->get_last_child() ) {
150
+                    if (!$l->get_last_child()) {
151 151
                         $l = null;
152 152
                         break;
153 153
                     }
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
             if ($l) {
159 159
                 $l_style = $l->get_style();
160 160
                 $b = max($b, (float)$l_style->length_in_pt($l_style->margin_bottom, $cb["h"]));
161
-                $style->margin_bottom = $b."pt";
161
+                $style->margin_bottom = $b . "pt";
162 162
                 $l_style->margin_bottom = "0pt";
163 163
             }
164 164
         }
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 
284 284
         // Convert escaped hex characters into ascii characters (e.g. \A => newline)
285 285
         $string = preg_replace_callback("/\\\\([0-9a-fA-F]{0,6})/",
286
-            function ($matches) { return \Dompdf\Helpers::unichr(hexdec($matches[1])); },
286
+            function($matches) { return \Dompdf\Helpers::unichr(hexdec($matches[1])); },
287 287
             $string);
288 288
         return $string;
289 289
     }
Please login to merge, or discard this patch.
src/Frame/FrameTree.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -210,7 +210,7 @@
 block discarded – undo
210 210
         if (isset($previousChild, $nextChild)) {
211 211
             if ($previousChild->nodeName === "#text" && $nextChild->nodeName === "#text") {
212 212
                 $previousChild->nodeValue .= $nextChild->nodeValue;
213
-                $this->_remove_node($node, $children, $index+1);
213
+                $this->_remove_node($node, $children, $index + 1);
214 214
             }
215 215
         }
216 216
         array_splice($children, $index, 1);
Please login to merge, or discard this patch.
src/Css/Color.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -199,14 +199,14 @@
 block discarded – undo
199 199
             return $cache[$color] = self::getArray($color[1] . $color[1] . $color[2] . $color[2] . $color[3] . $color[3]);
200 200
         } // #rgba format
201 201
         else if ($length == 5 && $color[0] === "#") {
202
-            $alpha = round(hexdec($color[4] . $color[4])/255, 2);
202
+            $alpha = round(hexdec($color[4] . $color[4]) / 255, 2);
203 203
             return $cache[$color] = self::getArray($color[1] . $color[1] . $color[2] . $color[2] . $color[3] . $color[3], $alpha);
204 204
         } // #rrggbb format
205 205
         else if ($length == 7 && $color[0] === "#") {
206 206
             return $cache[$color] = self::getArray(mb_substr($color, 1, 6));
207 207
         } // #rrggbbaa format
208 208
         else if ($length == 9 && $color[0] === "#") {
209
-            $alpha = round(hexdec(mb_substr($color, 7, 2))/255, 2);
209
+            $alpha = round(hexdec(mb_substr($color, 7, 2)) / 255, 2);
210 210
             return $cache[$color] = self::getArray(mb_substr($color, 1, 8), $alpha);
211 211
         } // rgb( r,g,b ) / rgba( r,g,b,α ) format
212 212
         else if (mb_strpos($color, "rgb") !== false) {
Please login to merge, or discard this patch.
src/Css/Style.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
         if (!isset(self::$_defaults)) {
234 234
 
235 235
             // Shorthand
236
-            $d =& self::$_defaults;
236
+            $d = & self::$_defaults;
237 237
 
238 238
             // All CSS 2.1 properties, and their default values
239 239
             $d["azimuth"] = "center";
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 
710 710
                 // Clear out "inherit" shorthand properties if specific properties have been set
711 711
                 $shorthands = array_filter($shorthand_properties, function($el) use ($prop) {
712
-                    return ( strpos($prop, $el."_") !== false );
712
+                    return (strpos($prop, $el . "_") !== false);
713 713
                 });
714 714
                 foreach ($shorthands as $shorthand) {
715 715
                     if (array_key_exists($shorthand, $this->_props) && $this->_props[$shorthand] === "inherit") {
@@ -1786,7 +1786,7 @@  discard block
 block discarded – undo
1786 1786
             print "<pre>[_image\n";
1787 1787
             print_r($parsed_url);
1788 1788
             print $this->_stylesheet->get_protocol() . "\n" . $this->_stylesheet->get_base_path() . "\n" . $path . "\n";
1789
-            print "_image]</pre>";;
1789
+            print "_image]</pre>"; ;
1790 1790
         }
1791 1791
         return $path;
1792 1792
     }
Please login to merge, or discard this patch.