Completed
Pull Request — master (#256)
by
unknown
02:31
created
src/Knp/Snappy/Image.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -28,55 +28,55 @@
 block discarded – undo
28 28
     protected function configure()
29 29
     {
30 30
         $this->addOptions(array(
31
-            'allow'                        => null,    // Allow the file or files from the specified folder to be loaded (repeatable)
32
-            'checkbox-checked-svg'         => null,    // Use this SVG file when rendering checked checkboxes
33
-            'checked-svg'                  => null,    // Use this SVG file when rendering unchecked checkboxes
34
-            'cookie'                       => [],      // Set an additional cookie (repeatable)
35
-            'cookie-jar'                   => null,    // Read and write cookies from and to the supplied cookie jar file
36
-            'crop-h'                       => null,    // Set height for cropping
37
-            'crop-w'                       => null,    // Set width for cropping
38
-            'crop-x'                       => null,    // Set x coordinate for cropping (default 0)
39
-            'crop-y'                       => null,    // Set y coordinate for cropping (default 0)
40
-            'custom-header'                => [],      // Set an additional HTTP header (repeatable)
41
-            'custom-header-propagation'    => null,    // Add HTTP headers specified by --custom-header for each resource request.
42
-            'no-custom-header-propagation' => null,    // Do not add HTTP headers specified by --custom-header for each resource request.
43
-            'debug-javascript'             => null,    // Show javascript debugging output
44
-            'no-debug-javascript'          => null,    // Do not show javascript debugging output (default)
45
-            'encoding'                     => null,    // Set the default text encoding, for input
46
-            'format'                       => $this->getDefaultExtension(),   // Output format
47
-            'height'                       => null,    // Set screen height (default is calculated from page content) (default 0)
48
-            'images'                       => null,    // Do load or print images (default)
49
-            'no-images'                    => null,    // Do not load or print images
50
-            'disable-javascript'           => null,    // Do not allow web pages to run javascript
51
-            'enable-javascript'            => null,    // Do allow web pages to run javascript (default)
52
-            'javascript-delay'             => null,    // Wait some milliseconds for javascript finish (default 200)
53
-            'load-error-handling'          => null,    // Specify how to handle pages that fail to load: abort, ignore or skip (default abort)
54
-            'load-media-error-handling'    => null,    // Specify how to handle media files that fail to load: abort, ignore or skip (default ignore)
55
-            'disable-local-file-access'    => null,    // Do not allowed conversion of a local file to read in other local files, unless explicitly allowed with allow
56
-            'enable-local-file-access'     => null,    // Allowed conversion of a local file to read in other local files. (default)
57
-            'minimum-font-size'            => null,    // Minimum font size
58
-            'password'                     => null,    // HTTP Authentication password
59
-            'disable-plugins'              => null,    // Disable installed plugins (default)
60
-            'enable-plugins'               => null,    // Enable installed plugins (plugins will likely not work)
61
-            'post'                         => [],      // Add an additional post field
62
-            'post-file'                    => [],      // Post an additional file
63
-            'proxy'                        => null,    // Use a proxy
64
-            'quality'                      => null,    // Output image quality (between 0 and 100) (default 94)
65
-            'radiobutton-checked-svg'      => null,    // Use this SVG file when rendering checked radio-buttons
66
-            'radiobutton-svg'              => null,    // Use this SVG file when rendering unchecked radio-buttons
67
-            'run-script'                   => null,    // Run this additional javascript after the page is done loading (repeatable)
68
-            'disable-smart-width'          => null,    // Use the specified width even if it is not large enough for the content
69
-            'enable-smart-width'           => null,    // Extend --width to fit unbreakable content (default)
70
-            'stop-slow-scripts'            => null,    // Stop slow running javascript
71
-            'no-stop-slow-scripts'         => null,    // Do not stop slow running javascript (default)
72
-            'transparent'                  => null,    // Make the background transparent in pngs *
73
-            'use-xserver'                  => null,    // Use the X server (some plugins and other stuff might not work without X11)
74
-            'user-style-sheet'             => null,    // Specify a user style sheet, to load with every page
75
-            'username'                     => null,    // HTTP Authentication username
76
-            'width'                        => null,    // Set screen width (default is 1024)
77
-            'window-status'                => null,    // Wait until window.status is equal to this string before rendering page
78
-            'zoom'                         => null,    // Use this zoom factor (default 1)
79
-            'quiet'                        => null,    // Be less verbose
31
+            'allow'                        => null, // Allow the file or files from the specified folder to be loaded (repeatable)
32
+            'checkbox-checked-svg'         => null, // Use this SVG file when rendering checked checkboxes
33
+            'checked-svg'                  => null, // Use this SVG file when rendering unchecked checkboxes
34
+            'cookie'                       => [], // Set an additional cookie (repeatable)
35
+            'cookie-jar'                   => null, // Read and write cookies from and to the supplied cookie jar file
36
+            'crop-h'                       => null, // Set height for cropping
37
+            'crop-w'                       => null, // Set width for cropping
38
+            'crop-x'                       => null, // Set x coordinate for cropping (default 0)
39
+            'crop-y'                       => null, // Set y coordinate for cropping (default 0)
40
+            'custom-header'                => [], // Set an additional HTTP header (repeatable)
41
+            'custom-header-propagation'    => null, // Add HTTP headers specified by --custom-header for each resource request.
42
+            'no-custom-header-propagation' => null, // Do not add HTTP headers specified by --custom-header for each resource request.
43
+            'debug-javascript'             => null, // Show javascript debugging output
44
+            'no-debug-javascript'          => null, // Do not show javascript debugging output (default)
45
+            'encoding'                     => null, // Set the default text encoding, for input
46
+            'format'                       => $this->getDefaultExtension(), // Output format
47
+            'height'                       => null, // Set screen height (default is calculated from page content) (default 0)
48
+            'images'                       => null, // Do load or print images (default)
49
+            'no-images'                    => null, // Do not load or print images
50
+            'disable-javascript'           => null, // Do not allow web pages to run javascript
51
+            'enable-javascript'            => null, // Do allow web pages to run javascript (default)
52
+            'javascript-delay'             => null, // Wait some milliseconds for javascript finish (default 200)
53
+            'load-error-handling'          => null, // Specify how to handle pages that fail to load: abort, ignore or skip (default abort)
54
+            'load-media-error-handling'    => null, // Specify how to handle media files that fail to load: abort, ignore or skip (default ignore)
55
+            'disable-local-file-access'    => null, // Do not allowed conversion of a local file to read in other local files, unless explicitly allowed with allow
56
+            'enable-local-file-access'     => null, // Allowed conversion of a local file to read in other local files. (default)
57
+            'minimum-font-size'            => null, // Minimum font size
58
+            'password'                     => null, // HTTP Authentication password
59
+            'disable-plugins'              => null, // Disable installed plugins (default)
60
+            'enable-plugins'               => null, // Enable installed plugins (plugins will likely not work)
61
+            'post'                         => [], // Add an additional post field
62
+            'post-file'                    => [], // Post an additional file
63
+            'proxy'                        => null, // Use a proxy
64
+            'quality'                      => null, // Output image quality (between 0 and 100) (default 94)
65
+            'radiobutton-checked-svg'      => null, // Use this SVG file when rendering checked radio-buttons
66
+            'radiobutton-svg'              => null, // Use this SVG file when rendering unchecked radio-buttons
67
+            'run-script'                   => null, // Run this additional javascript after the page is done loading (repeatable)
68
+            'disable-smart-width'          => null, // Use the specified width even if it is not large enough for the content
69
+            'enable-smart-width'           => null, // Extend --width to fit unbreakable content (default)
70
+            'stop-slow-scripts'            => null, // Stop slow running javascript
71
+            'no-stop-slow-scripts'         => null, // Do not stop slow running javascript (default)
72
+            'transparent'                  => null, // Make the background transparent in pngs *
73
+            'use-xserver'                  => null, // Use the X server (some plugins and other stuff might not work without X11)
74
+            'user-style-sheet'             => null, // Specify a user style sheet, to load with every page
75
+            'username'                     => null, // HTTP Authentication username
76
+            'width'                        => null, // Set screen width (default is 1024)
77
+            'window-status'                => null, // Wait until window.status is equal to this string before rendering page
78
+            'zoom'                         => null, // Use this zoom factor (default 1)
79
+            'quiet'                        => null, // Be less verbose
80 80
         ));
81 81
     }
82 82
 }
Please login to merge, or discard this patch.
src/Knp/Snappy/AbstractGenerator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
      */
338 338
     protected function checkProcessStatus($status, $stdout, $stderr, $command)
339 339
     {
340
-        if  (0 === $status || '' === $stderr){
340
+        if (0 === $status || '' === $stderr) {
341 341
             return;
342 342
         }
343 343
         if ($this->isIgnoreContentNotFound() && 1 === $status && preg_match('/contentnotfound/i', $stderr)) {
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
             throw new \RuntimeException(sprintf("Unable to write in directory: %s\n", $dir));
374 374
         }
375 375
 
376
-        $filename = $dir . DIRECTORY_SEPARATOR . uniqid('knp_snappy', true);
376
+        $filename = $dir.DIRECTORY_SEPARATOR.uniqid('knp_snappy', true);
377 377
 
378 378
         if (null !== $extension) {
379 379
             $filename .= '.'.$extension;
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
                     if (in_array($key, ['toc', 'cover'])) {
444 444
                         $command .= ' '.$key.' '.escapeshellarg($option);
445 445
                     } elseif (in_array($key, ['image-dpi', 'image-quality'])) {
446
-                        $command .= ' --'.$key.' '. (int) $option;
446
+                        $command .= ' --'.$key.' '.(int)$option;
447 447
                     } else {
448 448
                         $command .= ' --'.$key.' '.escapeshellarg($option);
449 449
                     }
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
      */
474 474
     protected function isAssociativeArray(array $array)
475 475
     {
476
-        return (bool) count(array_filter(array_keys($array), 'is_string'));
476
+        return (bool)count(array_filter(array_keys($array), 'is_string'));
477 477
     }
478 478
 
479 479
     /**
Please login to merge, or discard this patch.