@@ -30,8 +30,8 @@ |
||
| 30 | 30 | |
| 31 | 31 | $size = $this->getOptionValue('size'); |
| 32 | 32 | // One size is actually no suffix... |
| 33 | - $size = ! empty($size) ? '_'. $size : ''; |
|
| 34 | - $thumb = preg_replace('#(.*)_\w(\.\w+)$#i', '$1'. $size .'$2', $thumb); |
|
| 33 | + $size = !empty($size) ? '_'.$size : ''; |
|
| 34 | + $thumb = preg_replace('#(.*)_\w(\.\w+)$#i', '$1'.$size.'$2', $thumb); |
|
| 35 | 35 | return $thumb; |
| 36 | 36 | } |
| 37 | 37 | } |
@@ -31,13 +31,13 @@ |
||
| 31 | 31 | $context = $this->getContext($timeout, false); |
| 32 | 32 | stream_context_set_default($context); |
| 33 | 33 | list($headers, $finalUrl) = $this->getRedirectedHeaders($url, $timeout, $maxRedr); |
| 34 | - if (! $headers || strpos($headers[0], '200 OK') === false) { |
|
| 34 | + if (!$headers || strpos($headers[0], '200 OK') === false) { |
|
| 35 | 35 | $context = $this->getContext($timeout, true); |
| 36 | 36 | stream_context_set_default($context); |
| 37 | 37 | list($headers, $finalUrl) = $this->getRedirectedHeaders($url, $timeout, $maxRedr); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - if (! $headers) { |
|
| 40 | + if (!$headers) { |
|
| 41 | 41 | return array($headers, false); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | public static function buildRegex($regex, $flags) |
| 26 | 26 | { |
| 27 | - return '{' . $regex . '}' . $flags; |
|
| 27 | + return '{'.$regex.'}'.$flags; |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /** |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | return false; |
| 47 | 47 | } |
| 48 | 48 | } else { |
| 49 | - if (! isset($rules[$value])) { |
|
| 49 | + if (!isset($rules[$value])) { |
|
| 50 | 50 | return false; |
| 51 | 51 | } |
| 52 | 52 | } |
@@ -26,14 +26,14 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public static function loadJson($jsonFile) |
| 28 | 28 | { |
| 29 | - if (! file_exists($jsonFile) || ! is_readable($jsonFile)) { |
|
| 29 | + if (!file_exists($jsonFile) || !is_readable($jsonFile)) { |
|
| 30 | 30 | throw new IOException('JSON resource file not found or not readable.'); |
| 31 | 31 | } |
| 32 | 32 | $data = json_decode(file_get_contents($jsonFile), true); |
| 33 | 33 | if ($data === null) { |
| 34 | 34 | $error = json_last_error(); |
| 35 | 35 | $msg = json_last_error_msg(); |
| 36 | - throw new BadRulesException('An error occured while parsing JSON file: error code #'. $error .': '. $msg); |
|
| 36 | + throw new BadRulesException('An error occured while parsing JSON file: error code #'.$error.': '.$msg); |
|
| 37 | 37 | } |
| 38 | 38 | return $data; |
| 39 | 39 | } |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | */ |
| 51 | 51 | public static function isMetaSize($size) |
| 52 | 52 | { |
| 53 | - $metaSize = array ( |
|
| 53 | + $metaSize = array( |
|
| 54 | 54 | WebThumbnailer::SIZE_SMALL, |
| 55 | 55 | WebThumbnailer::SIZE_MEDIUM, |
| 56 | 56 | WebThumbnailer::SIZE_LARGE |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | public static function checkExtensionRequirements($required) |
| 17 | 17 | { |
| 18 | 18 | foreach ($required as $extension) { |
| 19 | - if (! extension_loaded($extension)) { |
|
| 19 | + if (!extension_loaded($extension)) { |
|
| 20 | 20 | throw new MissingRequirementException(sprintf( |
| 21 | 21 | 'PHP extension php-%s is required and must be loaded', |
| 22 | 22 | $extension |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | public static function getWebAccess($url = null) |
| 22 | 22 | { |
| 23 | 23 | // Local file |
| 24 | - if (! empty($url) && $url[0] === '/') { |
|
| 24 | + if (!empty($url) && $url[0] === '/') { |
|
| 25 | 25 | return new WebAccessLocal(); |
| 26 | 26 | } |
| 27 | 27 | |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | if (preg_match($this->urlRegex, $this->url, $matches) !== 0) { |
| 61 | 61 | $total = count($matches); |
| 62 | 62 | for ($i = 1; $i < $total; $i++) { |
| 63 | - $this->thumbnailUrl = str_replace('${'. $i . '}', $matches[$i], $this->thumbnailUrl); |
|
| 63 | + $this->thumbnailUrl = str_replace('${'.$i.'}', $matches[$i], $this->thumbnailUrl); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | // Match only options (not ${number}) |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | /** |
| 13 | 13 | * @var string Path to resources folder. |
| 14 | 14 | */ |
| 15 | - const RESOURCES_PATH = __DIR__ . DIRECTORY_SEPARATOR .'..'. DIRECTORY_SEPARATOR .'resources'. DIRECTORY_SEPARATOR; |
|
| 15 | + const RESOURCES_PATH = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR; |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Build the real path from all given folders, with a trailing /. |
@@ -28,10 +28,10 @@ discard block |
||
| 28 | 28 | return false; |
| 29 | 29 | } |
| 30 | 30 | foreach ($args as $arg) { |
| 31 | - $out .= rtrim(rtrim($arg, '/'), '\\') . DIRECTORY_SEPARATOR; |
|
| 31 | + $out .= rtrim(rtrim($arg, '/'), '\\').DIRECTORY_SEPARATOR; |
|
| 32 | 32 | } |
| 33 | 33 | $out = realpath($out); |
| 34 | - return $out !== false ? $out . DIRECTORY_SEPARATOR : false; |
|
| 34 | + return $out !== false ? $out.DIRECTORY_SEPARATOR : false; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public static function rmdir($path) |
| 45 | 45 | { |
| 46 | - if (empty($path) || $path == '/' || ! self::getPath($path)) { |
|
| 46 | + if (empty($path) || $path == '/' || !self::getPath($path)) { |
|
| 47 | 47 | return false; |
| 48 | 48 | } |
| 49 | 49 | |