@@ -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 |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | */ |
21 | 21 | public static function getDomain($url) |
22 | 22 | { |
23 | - if (! parse_url($url, PHP_URL_SCHEME)) { |
|
24 | - $url = 'http://' . $url; |
|
23 | + if (!parse_url($url, PHP_URL_SCHEME)) { |
|
24 | + $url = 'http://'.$url; |
|
25 | 25 | } |
26 | 26 | return strtolower(parse_url($url, PHP_URL_HOST)); |
27 | 27 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | public static function generateRelativeUrlFromPath($server, $path) |
42 | 42 | { |
43 | 43 | if (isset($server['DOCUMENT_ROOT'])) { |
44 | - $root = ! empty($server['DOCUMENT_ROOT']) ? rtrim($server['DOCUMENT_ROOT'], '/') .'/' : ''; |
|
44 | + $root = !empty($server['DOCUMENT_ROOT']) ? rtrim($server['DOCUMENT_ROOT'], '/').'/' : ''; |
|
45 | 45 | return substr($path, strlen($root)); |
46 | 46 | } |
47 | 47 | return $path; |
@@ -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}) |