@@ -9,8 +9,10 @@ |
||
| 9 | 9 | <? if (isset($dynamicBrick)) : |
| 10 | 10 | $fieldSlug = $field->slug; |
| 11 | 11 | $value = isset($dynamicBrick->fields->$fieldSlug) ? current($dynamicBrick->fields->$fieldSlug) : ''; |
| 12 | - else : |
|
| 12 | + else { |
|
| 13 | + : |
|
| 13 | 14 | $value = ''; |
| 15 | + } |
|
| 14 | 16 | endif ?> |
| 15 | 17 | <? if ($field->multiple == true && $field->type != 'Rich Text') : ?> |
| 16 | 18 | <ul class="grid-wrapper sortable"> |
@@ -61,7 +61,9 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | protected function calculateX($imageResource) |
| 63 | 63 | { |
| 64 | - if (intval($this->_x) === $this->_x) return $this->_x; |
|
| 64 | + if (intval($this->_x) === $this->_x) { |
|
| 65 | + return $this->_x; |
|
| 66 | + } |
|
| 65 | 67 | |
| 66 | 68 | $x = strtolower($this->_x); |
| 67 | 69 | |
@@ -86,7 +88,9 @@ discard block |
||
| 86 | 88 | */ |
| 87 | 89 | public function calculateY($imageResource) |
| 88 | 90 | { |
| 89 | - if (intval($this->_y) === $this->_y) return $this->_y; |
|
| 91 | + if (intval($this->_y) === $this->_y) { |
|
| 92 | + return $this->_y; |
|
| 93 | + } |
|
| 90 | 94 | |
| 91 | 95 | $y = strtolower($this->_y); |
| 92 | 96 | |
@@ -123,7 +127,9 @@ discard block |
||
| 123 | 127 | */ |
| 124 | 128 | public function GetWatermark() |
| 125 | 129 | { |
| 126 | - if ($this->_watermark == null) throw new \Exception('A watermark is not set. Please supply a \library\image\Image using $this->SetWatermark'); |
|
| 130 | + if ($this->_watermark == null) { |
|
| 131 | + throw new \Exception('A watermark is not set. Please supply a \library\image\Image using $this->SetWatermark'); |
|
| 132 | + } |
|
| 127 | 133 | return $this->_watermark; |
| 128 | 134 | } |
| 129 | 135 | |
@@ -26,7 +26,9 @@ |
||
| 26 | 26 | |
| 27 | 27 | // Define which ratio will be used, depending on which is the smallest side |
| 28 | 28 | $ratio = min($hRatio, $wRatio); |
| 29 | - if($ratio > 1) $ratio = 1; |
|
| 29 | + if($ratio > 1) { |
|
| 30 | + $ratio = 1; |
|
| 31 | + } |
|
| 30 | 32 | |
| 31 | 33 | // Define sizes |
| 32 | 34 | $this->_destWidth = floor($originalWidth * $ratio); |
@@ -40,7 +40,9 @@ |
||
| 40 | 40 | |
| 41 | 41 | // Define which ratio will be used, depending on which is the biggest side |
| 42 | 42 | $ratio = $wRatio < $hRatio ? $wRatio : $hRatio; |
| 43 | - if ($ratio < 1) $ratio = 1; |
|
| 43 | + if ($ratio < 1) { |
|
| 44 | + $ratio = 1; |
|
| 45 | + } |
|
| 44 | 46 | |
| 45 | 47 | // Calculate the destination width, height, x and y |
| 46 | 48 | $this->_destWidth = $originalWidth / $ratio; |
@@ -105,7 +105,7 @@ |
||
| 105 | 105 | /** |
| 106 | 106 | * Detect if the language is switched manually |
| 107 | 107 | * |
| 108 | - * @param $request |
|
| 108 | + * @param Request $request |
|
| 109 | 109 | */ |
| 110 | 110 | private function checkLanguageSwitch($request) |
| 111 | 111 | { |
@@ -21,7 +21,9 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public static function renderError($message = '', $file = '', $line = '', $code = 0, $trace = array(), $httpHeader = 'HTTP/1.0 500 Internal Server Error') |
| 23 | 23 | { |
| 24 | - if (ob_get_contents()) ob_end_clean(); |
|
| 24 | + if (ob_get_contents()) { |
|
| 25 | + ob_end_clean(); |
|
| 26 | + } |
|
| 25 | 27 | $line = intval($line); |
| 26 | 28 | |
| 27 | 29 | if (self::canShowError()) { |
@@ -85,7 +87,9 @@ discard block |
||
| 85 | 87 | |
| 86 | 88 | private static function renderCliException($message, $file, $line, $trace, $lines) |
| 87 | 89 | { |
| 88 | - if (ob_get_contents()) ob_end_clean(); |
|
| 90 | + if (ob_get_contents()) { |
|
| 91 | + ob_end_clean(); |
|
| 92 | + } |
|
| 89 | 93 | include(__DIR__ . DIRECTORY_SEPARATOR . 'errortemplates/errorviewcli.php'); |
| 90 | 94 | exit; |
| 91 | 95 | } |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | $error = error_get_last(); |
| 35 | 35 | if (isset($error['type'], $error['message'], $error['file'], $error['line'])) { |
| 36 | 36 | \library\cc\ErrorHandlingUtil::renderError($error['message'],$error['file'],$error['line'], $error['type']); |
| 37 | - }elseif ($error['type'] == 1) { |
|
| 37 | + } elseif ($error['type'] == 1) { |
|
| 38 | 38 | dump($error); |
| 39 | 39 | } |
| 40 | 40 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | * @param string $imagePath |
| 77 | 77 | * @param bool $getExtension |
| 78 | 78 | * |
| 79 | - * @return bool|int|string |
|
| 79 | + * @return integer |
|
| 80 | 80 | */ |
| 81 | 81 | public function getImageMimeType($imagePath, $getExtension = false) |
| 82 | 82 | { |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | /** |
| 152 | - * @param $pathToBitmapFile |
|
| 152 | + * @param string $pathToBitmapFile |
|
| 153 | 153 | * |
| 154 | 154 | * @return string |
| 155 | 155 | */ |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /** |
| 168 | - * @param $header |
|
| 168 | + * @param string $header |
|
| 169 | 169 | * |
| 170 | 170 | * @return array |
| 171 | 171 | */ |
@@ -195,14 +195,14 @@ discard block |
||
| 195 | 195 | * Loop through the data in the body of the bitmap |
| 196 | 196 | * file and calculate each individual pixel based on the |
| 197 | 197 | * bytes |
| 198 | - * @param $bodySize |
|
| 199 | - * @param $x |
|
| 198 | + * @param integer $bodySize |
|
| 199 | + * @param integer $x |
|
| 200 | 200 | * @param $width |
| 201 | - * @param $usePadding |
|
| 202 | - * @param $y |
|
| 201 | + * @param boolean $usePadding |
|
| 202 | + * @param integer $y |
|
| 203 | 203 | * @param $height |
| 204 | - * @param $body |
|
| 205 | - * @param $image |
|
| 204 | + * @param string $body |
|
| 205 | + * @param resource $image |
|
| 206 | 206 | */ |
| 207 | 207 | private function loopThroughBodyAndCalculatePixels($bodySize, $x, $width, $usePadding, $y, $height, $body, $image) |
| 208 | 208 | { |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | - * @param $request |
|
| 71 | + * @param Request $request |
|
| 72 | 72 | * @param CmsComponent $cmsComponent |
| 73 | 73 | */ |
| 74 | 74 | private function newRoute($request, $cmsComponent) |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
| 86 | - * @param $request |
|
| 86 | + * @param Request $request |
|
| 87 | 87 | * @param CmsComponent $cmsComponent |
| 88 | 88 | */ |
| 89 | 89 | private function deleteRoute($request, $cmsComponent) |