Passed
Push — master ( 78102a...165ad2 )
by
unknown
01:02
created
src/Adapter/CPDF.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1000,7 +1000,7 @@  discard block
 block discarded – undo
1000 1000
     public function page_script($callback): void
1001 1001
     {
1002 1002
         if (is_string($callback)) {
1003
-            $this->processPageScript(function (
1003
+            $this->processPageScript(function(
1004 1004
                 int $PAGE_NUM,
1005 1005
                 int $PAGE_COUNT,
1006 1006
                 self $pdf,
@@ -1016,7 +1016,7 @@  discard block
 block discarded – undo
1016 1016
 
1017 1017
     public function page_text($x, $y, $text, $font, $size, $color = [0, 0, 0], $word_space = 0.0, $char_space = 0.0, $angle = 0.0)
1018 1018
     {
1019
-        $this->processPageScript(function (int $pageNumber, int $pageCount) use ($x, $y, $text, $font, $size, $color, $word_space, $char_space, $angle) {
1019
+        $this->processPageScript(function(int $pageNumber, int $pageCount) use ($x, $y, $text, $font, $size, $color, $word_space, $char_space, $angle) {
1020 1020
             $text = str_replace(
1021 1021
                 ["{PAGE_NUM}", "{PAGE_COUNT}"],
1022 1022
                 [$pageNumber, $pageCount],
@@ -1028,7 +1028,7 @@  discard block
 block discarded – undo
1028 1028
 
1029 1029
     public function page_line($x1, $y1, $x2, $y2, $color, $width, $style = [])
1030 1030
     {
1031
-        $this->processPageScript(function () use ($x1, $y1, $x2, $y2, $color, $width, $style) {
1031
+        $this->processPageScript(function() use ($x1, $y1, $x2, $y2, $color, $width, $style) {
1032 1032
             $this->line($x1, $y1, $x2, $y2, $color, $width, $style);
1033 1033
         });
1034 1034
     }
Please login to merge, or discard this patch.
Braces   +24 added lines, -8 removed lines patch added patch discarded remove patch
@@ -649,28 +649,38 @@  discard block
 block discarded – undo
649 649
             case "gif":
650 650
             /** @noinspection PhpMissingBreakStatementInspection */
651 651
             case "bmp":
652
-                if ($debug_png) print "!!!{$type}!!!";
652
+                if ($debug_png) {
653
+                    print "!!!{$type}!!!";
654
+                }
653 655
                 $img = $this->_convert_to_png($img, $type);
654 656
                 if ($img === null) {
655
-                    if ($debug_png) print '!!!conversion to PDF failed!!!';
657
+                    if ($debug_png) {
658
+                        print '!!!conversion to PDF failed!!!';
659
+                    }
656 660
                     $this->image(Cache::$broken_image, $x, $y, $w, $h, $resolution);
657 661
                     break;
658 662
                 }
659 663
 
660 664
             case "png":
661
-                if ($debug_png) print '!!!png!!!';
665
+                if ($debug_png) {
666
+                    print '!!!png!!!';
667
+                }
662 668
 
663 669
                 $this->_pdf->addPngFromFile($img, $x, $this->y($y) - $h, $w, $h);
664 670
                 break;
665 671
 
666 672
             case "svg":
667
-                if ($debug_png) print '!!!SVG!!!';
673
+                if ($debug_png) {
674
+                    print '!!!SVG!!!';
675
+                }
668 676
 
669 677
                 $this->_pdf->addSvgFromFile($img, $x, $this->y($y) - $h, $w, $h);
670 678
                 break;
671 679
 
672 680
             default:
673
-                if ($debug_png) print '!!!unknown!!!';
681
+                if ($debug_png) {
682
+                    print '!!!unknown!!!';
683
+                }
674 684
         }
675 685
     }
676 686
 
@@ -899,8 +909,12 @@  discard block
 block discarded – undo
899 909
             die("Unable to stream pdf: headers already sent");
900 910
         }
901 911
 
902
-        if (!isset($options["compress"])) $options["compress"] = true;
903
-        if (!isset($options["Attachment"])) $options["Attachment"] = true;
912
+        if (!isset($options["compress"])) {
913
+            $options["compress"] = true;
914
+        }
915
+        if (!isset($options["Attachment"])) {
916
+            $options["Attachment"] = true;
917
+        }
904 918
 
905 919
         $debug = !$options['compress'];
906 920
         $tmp = ltrim($this->_pdf->output($debug));
@@ -919,7 +933,9 @@  discard block
 block discarded – undo
919 933
 
920 934
     public function output($options = [])
921 935
     {
922
-        if (!isset($options["compress"])) $options["compress"] = true;
936
+        if (!isset($options["compress"])) {
937
+            $options["compress"] = true;
938
+        }
923 939
 
924 940
         $debug = !$options['compress'];
925 941
 
Please login to merge, or discard this patch.
src/Adapter/PDFLib.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -938,7 +938,7 @@  discard block
 block discarded – undo
938 938
         if ($rTL > 0) {
939 939
             $path = $this->_pdf->add_path_point($path, 0, 0 - $rTL + $h, "elliptical", "radius=$rTL clockwise=false");
940 940
         }
941
-        $this->_pdf->draw_path($path, $x1, $this->_height-$y1-$h, "clip=true");
941
+        $this->_pdf->draw_path($path, $x1, $this->_height - $y1 - $h, "clip=true");
942 942
     }
943 943
 
944 944
     public function clipping_polygon(array $points): void
@@ -1214,7 +1214,7 @@  discard block
 block discarded – undo
1214 1214
     public function page_script($callback): void
1215 1215
     {
1216 1216
         if (is_string($callback)) {
1217
-            $this->processPageScript(function (
1217
+            $this->processPageScript(function(
1218 1218
                 int $PAGE_NUM,
1219 1219
                 int $PAGE_COUNT,
1220 1220
                 self $pdf,
@@ -1230,7 +1230,7 @@  discard block
 block discarded – undo
1230 1230
 
1231 1231
     public function page_text($x, $y, $text, $font, $size, $color = [0, 0, 0], $word_space = 0.0, $char_space = 0.0, $angle = 0.0)
1232 1232
     {
1233
-        $this->processPageScript(function (int $pageNumber, int $pageCount) use ($x, $y, $text, $font, $size, $color, $word_space, $char_space, $angle) {
1233
+        $this->processPageScript(function(int $pageNumber, int $pageCount) use ($x, $y, $text, $font, $size, $color, $word_space, $char_space, $angle) {
1234 1234
             $text = str_replace(
1235 1235
                 ["{PAGE_NUM}", "{PAGE_COUNT}"],
1236 1236
                 [$pageNumber, $pageCount],
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
 
1243 1243
     public function page_line($x1, $y1, $x2, $y2, $color, $width, $style = [])
1244 1244
     {
1245
-        $this->processPageScript(function () use ($x1, $y1, $x2, $y2, $color, $width, $style) {
1245
+        $this->processPageScript(function() use ($x1, $y1, $x2, $y2, $color, $width, $style) {
1246 1246
             $this->line($x1, $y1, $x2, $y2, $color, $width, $style);
1247 1247
         });
1248 1248
     }
Please login to merge, or discard this patch.