@@ -375,8 +375,8 @@ discard block |
||
375 | 375 | /** |
376 | 376 | * Destination object, used to specify the location for the user to jump to, presently on opening |
377 | 377 | * |
378 | - * @param $id |
|
379 | - * @param $action |
|
378 | + * @param integer $id |
|
379 | + * @param string $action |
|
380 | 380 | * @param string $options |
381 | 381 | * @return string|null |
382 | 382 | */ |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | * set the viewer preferences |
422 | 422 | * |
423 | 423 | * @param $id |
424 | - * @param $action |
|
424 | + * @param string $action |
|
425 | 425 | * @param string|array $options |
426 | 426 | * @return string|null |
427 | 427 | */ |
@@ -529,8 +529,8 @@ discard block |
||
529 | 529 | /** |
530 | 530 | * define the document catalog, the overall controller for the document |
531 | 531 | * |
532 | - * @param $id |
|
533 | - * @param $action |
|
532 | + * @param integer $id |
|
533 | + * @param string $action |
|
534 | 534 | * @param string|array $options |
535 | 535 | * @return string|null |
536 | 536 | */ |
@@ -603,8 +603,8 @@ discard block |
||
603 | 603 | /** |
604 | 604 | * object which is a parent to the pages in the document |
605 | 605 | * |
606 | - * @param $id |
|
607 | - * @param $action |
|
606 | + * @param integer $id |
|
607 | + * @param string $action |
|
608 | 608 | * @param string $options |
609 | 609 | * @return string|null |
610 | 610 | */ |
@@ -751,8 +751,8 @@ discard block |
||
751 | 751 | /** |
752 | 752 | * define the outlines in the doc, empty for now |
753 | 753 | * |
754 | - * @param $id |
|
755 | - * @param $action |
|
754 | + * @param integer $id |
|
755 | + * @param string $action |
|
756 | 756 | * @param string $options |
757 | 757 | * @return string|null |
758 | 758 | */ |
@@ -793,8 +793,8 @@ discard block |
||
793 | 793 | /** |
794 | 794 | * an object to hold the font description |
795 | 795 | * |
796 | - * @param $id |
|
797 | - * @param $action |
|
796 | + * @param integer $id |
|
797 | + * @param string $action |
|
798 | 798 | * @param string|array $options |
799 | 799 | * @return string|null |
800 | 800 | */ |
@@ -982,8 +982,8 @@ discard block |
||
982 | 982 | /** |
983 | 983 | * a font descriptor, needed for including additional fonts |
984 | 984 | * |
985 | - * @param $id |
|
986 | - * @param $action |
|
985 | + * @param integer $id |
|
986 | + * @param string $action |
|
987 | 987 | * @param string $options |
988 | 988 | * @return null|string |
989 | 989 | */ |
@@ -1047,8 +1047,8 @@ discard block |
||
1047 | 1047 | /** |
1048 | 1048 | * the font encoding |
1049 | 1049 | * |
1050 | - * @param $id |
|
1051 | - * @param $action |
|
1050 | + * @param integer $id |
|
1051 | + * @param string $action |
|
1052 | 1052 | * @param string $options |
1053 | 1053 | * @return null|string |
1054 | 1054 | */ |
@@ -1101,7 +1101,7 @@ discard block |
||
1101 | 1101 | * a descendent cid font, needed for unicode fonts |
1102 | 1102 | * |
1103 | 1103 | * @param $id |
1104 | - * @param $action |
|
1104 | + * @param string $action |
|
1105 | 1105 | * @param string|array $options |
1106 | 1106 | * @return null|string |
1107 | 1107 | */ |
@@ -1197,7 +1197,7 @@ discard block |
||
1197 | 1197 | * a font glyph to character map, needed for unicode fonts |
1198 | 1198 | * |
1199 | 1199 | * @param $id |
1200 | - * @param $action |
|
1200 | + * @param string $action |
|
1201 | 1201 | * @param string $options |
1202 | 1202 | * @return null|string |
1203 | 1203 | */ |
@@ -1253,8 +1253,8 @@ discard block |
||
1253 | 1253 | /** |
1254 | 1254 | * the document procset, solves some problems with printing to old PS printers |
1255 | 1255 | * |
1256 | - * @param $id |
|
1257 | - * @param $action |
|
1256 | + * @param integer $id |
|
1257 | + * @param string $action |
|
1258 | 1258 | * @param string $options |
1259 | 1259 | * @return null|string |
1260 | 1260 | */ |
@@ -1299,7 +1299,7 @@ discard block |
||
1299 | 1299 | /** |
1300 | 1300 | * define the document information |
1301 | 1301 | * |
1302 | - * @param $id |
|
1302 | + * @param integer $id |
|
1303 | 1303 | * @param $action |
1304 | 1304 | * @param string $options |
1305 | 1305 | * @return null|string |
@@ -1365,8 +1365,8 @@ discard block |
||
1365 | 1365 | /** |
1366 | 1366 | * an action object, used to link to URLS initially |
1367 | 1367 | * |
1368 | - * @param $id |
|
1369 | - * @param $action |
|
1368 | + * @param integer $id |
|
1369 | + * @param string $action |
|
1370 | 1370 | * @param string $options |
1371 | 1371 | * @return null|string |
1372 | 1372 | */ |
@@ -1426,8 +1426,8 @@ discard block |
||
1426 | 1426 | * an annotation object, this will add an annotation to the current page. |
1427 | 1427 | * initially will support just link annotations |
1428 | 1428 | * |
1429 | - * @param $id |
|
1430 | - * @param $action |
|
1429 | + * @param integer $id |
|
1430 | + * @param string $action |
|
1431 | 1431 | * @param string $options |
1432 | 1432 | * @return null|string |
1433 | 1433 | */ |
@@ -1493,7 +1493,7 @@ discard block |
||
1493 | 1493 | * a page object, it also creates a contents object to hold its contents |
1494 | 1494 | * |
1495 | 1495 | * @param $id |
1496 | - * @param $action |
|
1496 | + * @param string $action |
|
1497 | 1497 | * @param string $options |
1498 | 1498 | * @return null|string |
1499 | 1499 | */ |
@@ -1603,8 +1603,8 @@ discard block |
||
1603 | 1603 | /** |
1604 | 1604 | * the contents objects hold all of the content which appears on pages |
1605 | 1605 | * |
1606 | - * @param $id |
|
1607 | - * @param $action |
|
1606 | + * @param integer $id |
|
1607 | + * @param string $action |
|
1608 | 1608 | * @param string|array $options |
1609 | 1609 | * @return null|string |
1610 | 1610 | */ |
@@ -1669,8 +1669,8 @@ discard block |
||
1669 | 1669 | } |
1670 | 1670 | |
1671 | 1671 | /** |
1672 | - * @param $id |
|
1673 | - * @param $action |
|
1672 | + * @param integer $id |
|
1673 | + * @param string $action |
|
1674 | 1674 | * @return string|null |
1675 | 1675 | */ |
1676 | 1676 | protected function o_embedjs($id, $action) |
@@ -1700,8 +1700,8 @@ discard block |
||
1700 | 1700 | } |
1701 | 1701 | |
1702 | 1702 | /** |
1703 | - * @param $id |
|
1704 | - * @param $action |
|
1703 | + * @param integer $id |
|
1704 | + * @param string $action |
|
1705 | 1705 | * @param string $code |
1706 | 1706 | * @return null|string |
1707 | 1707 | */ |
@@ -1736,8 +1736,8 @@ discard block |
||
1736 | 1736 | /** |
1737 | 1737 | * an image object, will be an XObject in the document, includes description and data |
1738 | 1738 | * |
1739 | - * @param $id |
|
1740 | - * @param $action |
|
1739 | + * @param integer $id |
|
1740 | + * @param string $action |
|
1741 | 1741 | * @param string $options |
1742 | 1742 | * @return null|string |
1743 | 1743 | */ |
@@ -1878,8 +1878,8 @@ discard block |
||
1878 | 1878 | /** |
1879 | 1879 | * graphics state object |
1880 | 1880 | * |
1881 | - * @param $id |
|
1882 | - * @param $action |
|
1881 | + * @param integer $id |
|
1882 | + * @param string $action |
|
1883 | 1883 | * @param string $options |
1884 | 1884 | * @return null|string |
1885 | 1885 | */ |
@@ -1945,8 +1945,8 @@ discard block |
||
1945 | 1945 | /** |
1946 | 1946 | * encryption object. |
1947 | 1947 | * |
1948 | - * @param $id |
|
1949 | - * @param $action |
|
1948 | + * @param integer $id |
|
1949 | + * @param string $action |
|
1950 | 1950 | * @param string $options |
1951 | 1951 | * @return string|null |
1952 | 1952 | */ |
@@ -2580,7 +2580,7 @@ discard block |
||
2580 | 2580 | * note that encoding='none' will need to be used for symbolic fonts |
2581 | 2581 | * and 'differences' => an array of mappings between numbers 0->255 and character names. |
2582 | 2582 | * |
2583 | - * @param $fontName |
|
2583 | + * @param string $fontName |
|
2584 | 2584 | * @param string $encoding |
2585 | 2585 | * @param bool $set |
2586 | 2586 | * @return int |
@@ -4069,11 +4069,11 @@ discard block |
||
4069 | 4069 | * |
4070 | 4070 | * @param $x |
4071 | 4071 | * @param $y |
4072 | - * @param $angle |
|
4072 | + * @param integer $angle |
|
4073 | 4073 | * @param $size |
4074 | - * @param $wa |
|
4074 | + * @param integer $wa |
|
4075 | 4075 | * @param $text |
4076 | - * @return array |
|
4076 | + * @return double[] |
|
4077 | 4077 | */ |
4078 | 4078 | private function getTextPosition($x, $y, $angle, $size, $wa, $text) |
4079 | 4079 | { |
@@ -4568,7 +4568,7 @@ discard block |
||
4568 | 4568 | /** |
4569 | 4569 | * add content to the documents info object |
4570 | 4570 | * |
4571 | - * @param $label |
|
4571 | + * @param string $label |
|
4572 | 4572 | * @param int $value |
4573 | 4573 | */ |
4574 | 4574 | function addInfo($label, $value = 0) |
@@ -4608,8 +4608,8 @@ discard block |
||
4608 | 4608 | * extract an integer from a position in a byte stream |
4609 | 4609 | * |
4610 | 4610 | * @param $data |
4611 | - * @param $pos |
|
4612 | - * @param $num |
|
4611 | + * @param integer $pos |
|
4612 | + * @param integer $num |
|
4613 | 4613 | * @return int |
4614 | 4614 | */ |
4615 | 4615 | private function getBytes(&$data, $pos, $num) |
@@ -4709,8 +4709,8 @@ discard block |
||
4709 | 4709 | * @param $file |
4710 | 4710 | * @param $x |
4711 | 4711 | * @param $y |
4712 | - * @param $w |
|
4713 | - * @param $h |
|
4712 | + * @param integer $w |
|
4713 | + * @param integer $h |
|
4714 | 4714 | * @param $byte |
4715 | 4715 | */ |
4716 | 4716 | protected function addImagePngAlpha($file, $x, $y, $w, $h, $byte) |
@@ -4976,14 +4976,14 @@ discard block |
||
4976 | 4976 | /** |
4977 | 4977 | * add a PNG image into the document, from a memory buffer of the file |
4978 | 4978 | * |
4979 | - * @param $file |
|
4980 | - * @param $x |
|
4981 | - * @param $y |
|
4979 | + * @param string $file |
|
4980 | + * @param double $x |
|
4981 | + * @param double $y |
|
4982 | 4982 | * @param float $w |
4983 | 4983 | * @param float $h |
4984 | - * @param $data |
|
4984 | + * @param null|string $data |
|
4985 | 4985 | * @param bool $is_mask |
4986 | - * @param null $mask |
|
4986 | + * @param boolean|null $mask |
|
4987 | 4987 | */ |
4988 | 4988 | function addPngFromBuf($file, $x, $y, $w = 0.0, $h = 0.0, &$data, $is_mask = false, $mask = null) |
4989 | 4989 | { |
@@ -5319,7 +5319,7 @@ discard block |
||
5319 | 5319 | |
5320 | 5320 | /** |
5321 | 5321 | * common code used by the two JPEG adding functions |
5322 | - * @param $data |
|
5322 | + * @param null|string $data |
|
5323 | 5323 | * @param $x |
5324 | 5324 | * @param $y |
5325 | 5325 | * @param int $w |
@@ -5453,7 +5453,7 @@ discard block |
||
5453 | 5453 | * and for the user to add new ones for their fonts. The default bahavious can be overridden should |
5454 | 5454 | * that be desired. |
5455 | 5455 | * |
5456 | - * @param $family |
|
5456 | + * @param string $family |
|
5457 | 5457 | * @param string $options |
5458 | 5458 | */ |
5459 | 5459 | function setFontFamily($family, $options = '') |
@@ -343,7 +343,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -3810,8 +3810,12 @@ |
||
3810 | 3810 | die("Unable to stream pdf: headers already sent"); |
3811 | 3811 | } |
3812 | 3812 | |
3813 | - if (!isset($options["compress"])) $options["compress"] = true; |
|
3814 | - if (!isset($options["Attachment"])) $options["Attachment"] = true; |
|
3813 | + if (!isset($options["compress"])) { |
|
3814 | + $options["compress"] = true; |
|
3815 | + } |
|
3816 | + if (!isset($options["Attachment"])) { |
|
3817 | + $options["Attachment"] = true; |
|
3818 | + } |
|
3815 | 3819 | |
3816 | 3820 | $debug = !$options['compress']; |
3817 | 3821 | $tmp = ltrim($this->output($debug)); |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | /** |
254 | 254 | * Returns the Cpdf instance |
255 | 255 | * |
256 | - * @return \Cpdf |
|
256 | + * @return CPDF |
|
257 | 257 | */ |
258 | 258 | public function get_cpdf() |
259 | 259 | { |
@@ -1134,7 +1134,7 @@ discard block |
||
1134 | 1134 | /** |
1135 | 1135 | * Returns the PDF as a string. |
1136 | 1136 | * |
1137 | - * @param array $options Associative array: 'compress' => 1 or 0 (default 1). |
|
1137 | + * @param boolean $options Associative array: 'compress' => 1 or 0 (default 1). |
|
1138 | 1138 | * @return string |
1139 | 1139 | */ |
1140 | 1140 | public function output($options = array()) |
@@ -834,24 +834,32 @@ discard block |
||
834 | 834 | case "gif": |
835 | 835 | /** @noinspection PhpMissingBreakStatementInspection */ |
836 | 836 | case "bmp": |
837 | - if ($debug_png) print '!!!bmp or gif!!!'; |
|
837 | + if ($debug_png) { |
|
838 | + print '!!!bmp or gif!!!'; |
|
839 | + } |
|
838 | 840 | // @todo use cache for BMP and GIF |
839 | 841 | $img = $this->_convert_gif_bmp_to_png($img, $type); |
840 | 842 | |
841 | 843 | case "png": |
842 | - if ($debug_png) print '!!!png!!!'; |
|
844 | + if ($debug_png) { |
|
845 | + print '!!!png!!!'; |
|
846 | + } |
|
843 | 847 | |
844 | 848 | $this->_pdf->addPngFromFile($img, $x, $this->y($y) - $h, $w, $h); |
845 | 849 | break; |
846 | 850 | |
847 | 851 | case "svg": |
848 | - if ($debug_png) print '!!!SVG!!!'; |
|
852 | + if ($debug_png) { |
|
853 | + print '!!!SVG!!!'; |
|
854 | + } |
|
849 | 855 | |
850 | 856 | $this->_pdf->addSvgFromFile($img, $x, $this->y($y) - $h, $w, $h); |
851 | 857 | break; |
852 | 858 | |
853 | 859 | default: |
854 | - if ($debug_png) print '!!!unknown!!!'; |
|
860 | + if ($debug_png) { |
|
861 | + print '!!!unknown!!!'; |
|
862 | + } |
|
855 | 863 | } |
856 | 864 | } |
857 | 865 | |
@@ -1111,8 +1119,12 @@ discard block |
||
1111 | 1119 | die("Unable to stream pdf: headers already sent"); |
1112 | 1120 | } |
1113 | 1121 | |
1114 | - if (!isset($options["compress"])) $options["compress"] = true; |
|
1115 | - if (!isset($options["Attachment"])) $options["Attachment"] = true; |
|
1122 | + if (!isset($options["compress"])) { |
|
1123 | + $options["compress"] = true; |
|
1124 | + } |
|
1125 | + if (!isset($options["Attachment"])) { |
|
1126 | + $options["Attachment"] = true; |
|
1127 | + } |
|
1116 | 1128 | |
1117 | 1129 | $this->_add_page_text(); |
1118 | 1130 | |
@@ -1139,7 +1151,9 @@ discard block |
||
1139 | 1151 | */ |
1140 | 1152 | public function output($options = array()) |
1141 | 1153 | { |
1142 | - if (!isset($options["compress"])) $options["compress"] = true; |
|
1154 | + if (!isset($options["compress"])) { |
|
1155 | + $options["compress"] = true; |
|
1156 | + } |
|
1143 | 1157 | |
1144 | 1158 | $this->_add_page_text(); |
1145 | 1159 |
@@ -11,8 +11,6 @@ |
||
11 | 11 | use Dompdf\Dompdf; |
12 | 12 | use Dompdf\Helpers; |
13 | 13 | use Dompdf\Frame; |
14 | -use Dompdf\FrameDecorator\Table as TableFrameDecorator; |
|
15 | -use Dompdf\FrameDecorator\TableRow as TableRowFrameDecorator; |
|
16 | 14 | use Dompdf\Renderer; |
17 | 15 | |
18 | 16 | /** |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | |
520 | 520 | /** |
521 | 521 | * @param $c |
522 | - * @return bool|string |
|
522 | + * @return string|false |
|
523 | 523 | */ |
524 | 524 | public static function unichr($c) |
525 | 525 | { |
@@ -865,6 +865,9 @@ discard block |
||
865 | 865 | return array($result, $headers); |
866 | 866 | } |
867 | 867 | |
868 | + /** |
|
869 | + * @param string $str |
|
870 | + */ |
|
868 | 871 | public static function mb_ucwords($str) { |
869 | 872 | $max_len = mb_strlen($str); |
870 | 873 | if ($max_len === 1) { |
@@ -613,8 +613,7 @@ |
||
613 | 613 | $width = (int)$meta['width']; |
614 | 614 | $height = (int)$meta['height']; |
615 | 615 | $type = "bmp"; |
616 | - } |
|
617 | - else { |
|
616 | + } else { |
|
618 | 617 | if (strpos($data, "<svg") !== false) { |
619 | 618 | $doc = new \Svg\Document(); |
620 | 619 | $doc->loadFile($filename); |
@@ -93,7 +93,7 @@ |
||
93 | 93 | // set up bits for UTF-8 |
94 | 94 | $x = ($code & 0x3F) | 0x80; |
95 | 95 | if ($code < 0x800) { |
96 | - $y = (($code & 0x7FF) >> 6) | 0xC0; |
|
96 | + $y = (($code & 0x7FF) >> 6) | 0xC0; |
|
97 | 97 | } else { |
98 | 98 | $y = (($code & 0xFC0) >> 6) | 0x80; |
99 | 99 | if ($code < 0x10000) { |
@@ -97,8 +97,8 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -93,7 +93,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -243,8 +243,9 @@ |
||
243 | 243 | if (($tmp = $this->_line_break($text)) !== false) { |
244 | 244 | $add_line = $split < $tmp; |
245 | 245 | $split = min($tmp, $split); |
246 | - } else |
|
247 | - $add_line = true; |
|
246 | + } else { |
|
247 | + $add_line = true; |
|
248 | + } |
|
248 | 249 | |
249 | 250 | break; |
250 | 251 |
@@ -210,7 +210,7 @@ |
||
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); |