@@ -39,9 +39,9 @@ |
||
| 39 | 39 | if ($sizeInIni < $fileSize) { |
| 40 | 40 | throw new ConversionFailedException( |
| 41 | 41 | 'File is larger than your ' . $iniSettingId . ' (set in your php.ini). File size:' . |
| 42 | - round($fileSize/1024) . ' kb. ' . |
|
| 42 | + round($fileSize / 1024) . ' kb. ' . |
|
| 43 | 43 | $iniSettingId . ' in php.ini: ' . ini_get($iniSettingId) . |
| 44 | - ' (parsed as ' . round($sizeInIni/1024) . ' kb)' |
|
| 44 | + ' (parsed as ' . round($sizeInIni / 1024) . ' kb)' |
|
| 45 | 45 | ); |
| 46 | 46 | } |
| 47 | 47 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $options = self::processOptions($options); |
| 87 | 87 | |
| 88 | 88 | if ($options['headers']['last-modified']) { |
| 89 | - Header::setHeader("Last-Modified: " . gmdate("D, d M Y H:i:s", @filemtime($filename)) ." GMT"); |
|
| 89 | + Header::setHeader("Last-Modified: " . gmdate("D, d M Y H:i:s", @filemtime($filename)) . " GMT"); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | if ($options['headers']['content-type']) { |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | // Check string for something like this: max-age:86400 |
| 107 | 107 | if (preg_match('#max-age\\s*=\\s*(\\d*)#', $options['cache-control-header'], $matches)) { |
| 108 | 108 | $seconds = $matches[1]; |
| 109 | - Header::setHeader('Expires: '. gmdate('D, d M Y H:i:s \G\M\T', time() + intval($seconds))); |
|
| 109 | + Header::setHeader('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + intval($seconds))); |
|
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | } |
@@ -134,7 +134,7 @@ |
||
| 134 | 134 | $defaultConverterOptions = []; |
| 135 | 135 | |
| 136 | 136 | foreach ($this->options2->getOptionsMap() as $id => $option) { |
| 137 | - if ($option->isValueExplicitlySet() && ! ($option instanceof GhostOption)) { |
|
| 137 | + if ($option->isValueExplicitlySet() && !($option instanceof GhostOption)) { |
|
| 138 | 138 | //$this->logLn('hi' . $id); |
| 139 | 139 | $defaultConverterOptions[$id] = $option->getValue(); |
| 140 | 140 | } |
@@ -212,11 +212,11 @@ |
||
| 212 | 212 | { |
| 213 | 213 | $sourceSize = filesize($source); |
| 214 | 214 | $destSize = filesize($destination); |
| 215 | - $this->log(round(($sourceSize - $destSize)/$sourceSize * 100) . '% '); |
|
| 215 | + $this->log(round(($sourceSize - $destSize) / $sourceSize * 100) . '% '); |
|
| 216 | 216 | if ($sourceSize < 10000) { |
| 217 | - $this->logLn('(went from ' . strval($sourceSize) . ' bytes to '. strval($destSize) . ' bytes)'); |
|
| 217 | + $this->logLn('(went from ' . strval($sourceSize) . ' bytes to ' . strval($destSize) . ' bytes)'); |
|
| 218 | 218 | } else { |
| 219 | - $this->logLn('(went from ' . round($sourceSize/1024) . ' kb to ' . round($destSize/1024) . ' kb)'); |
|
| 219 | + $this->logLn('(went from ' . round($sourceSize / 1024) . ' kb to ' . round($destSize / 1024) . ' kb)'); |
|
| 220 | 220 | } |
| 221 | 221 | } |
| 222 | 222 | |
@@ -41,8 +41,8 @@ |
||
| 41 | 41 | private function convertTwoAndSelectSmallest() |
| 42 | 42 | { |
| 43 | 43 | $destination = $this->getDestination(); |
| 44 | - $destinationLossless = $destination . '.lossless.webp'; |
|
| 45 | - $destinationLossy = $destination . '.lossy.webp'; |
|
| 44 | + $destinationLossless = $destination . '.lossless.webp'; |
|
| 45 | + $destinationLossy = $destination . '.lossy.webp'; |
|
| 46 | 46 | |
| 47 | 47 | $this->logLn( |
| 48 | 48 | 'Encoding is set to auto - converting to both lossless and lossy and selecting the smallest file' |
@@ -49,10 +49,10 @@ discard block |
||
| 49 | 49 | parent::createOptions(); |
| 50 | 50 | |
| 51 | 51 | $this->options2->addOptions( |
| 52 | - new SensitiveStringOption('api-key', ''), /* for communicating with wpc api v.1+ */ |
|
| 53 | - new SensitiveStringOption('secret', ''), /* for communicating with wpc api v.0 */ |
|
| 52 | + new SensitiveStringOption('api-key', ''), /* for communicating with wpc api v.1+ */ |
|
| 53 | + new SensitiveStringOption('secret', ''), /* for communicating with wpc api v.0 */ |
|
| 54 | 54 | new SensitiveStringOption('api-url', ''), |
| 55 | - new SensitiveStringOption('url', ''), /* DO NOT USE. Only here to keep the protection */ |
|
| 55 | + new SensitiveStringOption('url', ''), /* DO NOT USE. Only here to keep the protection */ |
|
| 56 | 56 | new IntegerOption('api-version', 2, 0, 2), |
| 57 | 57 | new BooleanOption('crypt-api-key-in-transfer', false) /* new in api v.1 */ |
| 58 | 58 | ); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | ['.', '/'] |
| 69 | 69 | ); |
| 70 | 70 | |
| 71 | - for ($i=0; $i<22; $i++) { |
|
| 71 | + for ($i = 0; $i < 22; $i++) { |
|
| 72 | 72 | $salt .= $validCharsForSalt[array_rand($validCharsForSalt)]; |
| 73 | 73 | } |
| 74 | 74 | return $salt; |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | // otherwise encoding=auto would not work as expected |
| 278 | 278 | |
| 279 | 279 | if ($options['encoding'] == 'lossless') { |
| 280 | - $cmdOptions[] ='-near_lossless ' . $options['near-lossless']; |
|
| 280 | + $cmdOptions[] = '-near_lossless ' . $options['near-lossless']; |
|
| 281 | 281 | } else { |
| 282 | 282 | $this->logLn( |
| 283 | 283 | 'The near-lossless option ignored for lossy' |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | } else { |
| 428 | 428 | $this->log('. Result: '); |
| 429 | 429 | if ($returnCode == 127) { |
| 430 | - $this->logLn('*Exec failed* (the cwebp binary was not found at path: ' . $binary. ')'); |
|
| 430 | + $this->logLn('*Exec failed* (the cwebp binary was not found at path: ' . $binary . ')'); |
|
| 431 | 431 | } else { |
| 432 | 432 | if ($returnCode == 126) { |
| 433 | 433 | $this->logLn( |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | } |
| 444 | 444 | return $returnCode; |
| 445 | 445 | } |
| 446 | - return ''; // Will not happen. Just so phpstan doesn't complain |
|
| 446 | + return ''; // Will not happen. Just so phpstan doesn't complain |
|
| 447 | 447 | } |
| 448 | 448 | |
| 449 | 449 | /** |
@@ -683,7 +683,7 @@ discard block |
||
| 683 | 683 | 'Binaries ordered by version number.' |
| 684 | 684 | ); |
| 685 | 685 | foreach ($binaryVersions as $binary => $version) { |
| 686 | - $this->logLn('- ' . $binary . ': (version: ' . $version .')'); |
|
| 686 | + $this->logLn('- ' . $binary . ': (version: ' . $version . ')'); |
|
| 687 | 687 | } |
| 688 | 688 | |
| 689 | 689 | // Execute! |