@@ -45,7 +45,7 @@ |
||
45 | 45 | { |
46 | 46 | $this->template = $template; |
47 | 47 | $this->request = $request; |
48 | - $this->parameters = (array)$parameters; |
|
48 | + $this->parameters = (array) $parameters; |
|
49 | 49 | $this->matchedSitemapItem = $matchedSitemapItem; |
50 | 50 | } |
51 | 51 |
@@ -163,7 +163,7 @@ |
||
163 | 163 | if (isset($_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID])) { |
164 | 164 | $this->formId = $_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID]; |
165 | 165 | } else { |
166 | - $_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID] = (string)microtime(true); |
|
166 | + $_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID] = (string) microtime(true); |
|
167 | 167 | $_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName]['submitted'] = false; |
168 | 168 | $this->formId = $_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID]; |
169 | 169 | } |
@@ -27,7 +27,9 @@ |
||
27 | 27 | |
28 | 28 | // Define which ratio will be used, depending on which is the smallest side |
29 | 29 | $ratio = min($hRatio, $wRatio); |
30 | - if ($ratio > 1) $ratio = 1; |
|
30 | + if ($ratio > 1) { |
|
31 | + $ratio = 1; |
|
32 | + } |
|
31 | 33 | |
32 | 34 | // Define sizes |
33 | 35 | $this->_destWidth = floor($originalWidth * $ratio); |
@@ -37,7 +37,9 @@ |
||
37 | 37 | |
38 | 38 | // Define which ratio will be used, depending on which is the biggest side |
39 | 39 | $ratio = $wRatio < $hRatio ? $wRatio : $hRatio; |
40 | - if ($ratio < 1) $ratio = 1; |
|
40 | + if ($ratio < 1) { |
|
41 | + $ratio = 1; |
|
42 | + } |
|
41 | 43 | |
42 | 44 | // Calculate the destination width, height, x and y |
43 | 45 | $this->_destWidth = $originalWidth / $ratio; |
@@ -20,7 +20,7 @@ |
||
20 | 20 | public static function slugify($str, $replace = array(), $delimiter = '-') |
21 | 21 | { |
22 | 22 | if (!empty($replace)) { |
23 | - $str = str_replace((array)$replace, ' ', $str); |
|
23 | + $str = str_replace((array) $replace, ' ', $str); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | $clean = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str); |
@@ -78,12 +78,15 @@ |
||
78 | 78 | */ |
79 | 79 | public static function humanFileSize($size, $unit = "") |
80 | 80 | { |
81 | - if ((!$unit && $size >= 1 << 30) || $unit == "GB") |
|
82 | - return number_format($size / (1 << 30), 2) . "GB"; |
|
83 | - if ((!$unit && $size >= 1 << 20) || $unit == "MB") |
|
84 | - return number_format($size / (1 << 20), 2) . "MB"; |
|
85 | - if ((!$unit && $size >= 1 << 10) || $unit == "KB") |
|
86 | - return number_format($size / (1 << 10), 2) . "KB"; |
|
81 | + if ((!$unit && $size >= 1 << 30) || $unit == "GB") { |
|
82 | + return number_format($size / (1 << 30), 2) . "GB"; |
|
83 | + } |
|
84 | + if ((!$unit && $size >= 1 << 20) || $unit == "MB") { |
|
85 | + return number_format($size / (1 << 20), 2) . "MB"; |
|
86 | + } |
|
87 | + if ((!$unit && $size >= 1 << 10) || $unit == "KB") { |
|
88 | + return number_format($size / (1 << 10), 2) . "KB"; |
|
89 | + } |
|
87 | 90 | |
88 | 91 | return number_format($size) . " bytes"; |
89 | 92 | } |
@@ -151,7 +151,7 @@ |
||
151 | 151 | public function save() |
152 | 152 | { |
153 | 153 | $host = $this; |
154 | - array_map(function ($value) use ($host) { |
|
154 | + array_map(function($value) use ($host) { |
|
155 | 155 | $host->saveSubset($value); |
156 | 156 | }, $this->fileBasedSubsets); |
157 | 157 | } |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | { |
56 | 56 | if (!isset($_GET['unsanitized'])) { |
57 | 57 | $search = array( |
58 | - '/\>[^\S ]+/s', // strip whitespaces after tags, except space |
|
59 | - '/[^\S ]+\</s', // strip whitespaces before tags, except space |
|
60 | - '/(\s)+/s', // shorten multiple whitespace sequences |
|
58 | + '/\>[^\S ]+/s', // strip whitespaces after tags, except space |
|
59 | + '/[^\S ]+\</s', // strip whitespaces before tags, except space |
|
60 | + '/(\s)+/s', // shorten multiple whitespace sequences |
|
61 | 61 | '/<!--(.|\s)*?-->/' // Remove HTML comments |
62 | 62 | ); |
63 | 63 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | function utf8Convert($array) |
87 | 87 | { |
88 | - array_walk_recursive($array, function (&$item) { |
|
88 | + array_walk_recursive($array, function(&$item) { |
|
89 | 89 | if (!mb_detect_encoding($item, 'utf-8', true)) { |
90 | 90 | $item = utf8_encode($item); |
91 | 91 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function __construct($template, Request $request, $parameters, $matchedSitemapItem) |
41 | 41 | { |
42 | - $this->parameters = (array)$parameters; |
|
42 | + $this->parameters = (array) $parameters; |
|
43 | 43 | $this->checkParameters(); |
44 | 44 | |
45 | 45 | $lang = substr(isset($_SERVER[self::HTTP_ACCEPT_LANGUAGE]) ? $_SERVER[self::HTTP_ACCEPT_LANGUAGE] : self::$DEFAULT_LANGUAGE, 0, 2); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | unset($this->parameters[self::PARAMETER_LANGUAGE_PARAMETER_NAME]); |
77 | 77 | } |
78 | 78 | if (isset($this->parameters[self::PARAMETER_FORCE_REDIRECT])) { |
79 | - $this->forceRedirect = (bool)$this->parameters[self::PARAMETER_FORCE_REDIRECT]; |
|
79 | + $this->forceRedirect = (bool) $this->parameters[self::PARAMETER_FORCE_REDIRECT]; |
|
80 | 80 | unset($this->parameters[self::PARAMETER_FORCE_REDIRECT]); |
81 | 81 | } |
82 | 82 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | } |
36 | 36 | $object_vars = get_object_vars($valuelistObject->pairs); |
37 | 37 | ksort($object_vars); |
38 | - $valuelistObject->pairs = (object)$object_vars; |
|
38 | + $valuelistObject->pairs = (object) $object_vars; |
|
39 | 39 | |
40 | 40 | return new Valuelist($valuelistObject); |
41 | 41 | } else { |