Passed
Push — develop ( 73a06d...f47d3a )
by Jens
05:00 queued 01:24
created
cloudcontrol/templates/cms/documents/brick.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,8 +9,10 @@
 block discarded – undo
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">
Please login to merge, or discard this patch.
cloudcontrol/library/images/Image.php 1 patch
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -59,8 +59,7 @@  discard block
 block discarded – undo
59 59
 				return imagejpeg($imageResource, $path, $quality);
60 60
 			} elseif ($mimeTypeConstantValue == IMAGETYPE_PNG) {
61 61
 				return imagepng($imageResource, $path, (intval($quality / 10) -1));
62
-			}
63
-			else {
62
+			} else {
64 63
 				throw new \Exception('Not a valid mimetypeconstant given see function documentation');
65 64
 			}
66 65
 			return false;
@@ -101,8 +100,9 @@  discard block
 block discarded – undo
101 100
 			//    Load the image into a string 
102 101
 			$file    =    fopen($p_sFile,"rb"); 
103 102
 			$read    =    fread($file,10); 
104
-			while(!feof($file)&&($read<>"")) 
105
-				$read    .=    fread($file,1024); 
103
+			while(!feof($file)&&($read<>"")) {
104
+							$read    .=    fread($file,1024);
105
+			}
106 106
 			
107 107
 			$temp    =    unpack("H*",$read); 
108 108
 			$hex    =    $temp[1]; 
@@ -153,8 +153,9 @@  discard block
 block discarded – undo
153 153
 				{ 
154 154
 					//    If padding needed, ignore image-padding 
155 155
 					//    Shift i to the ending of the current 32-bit-block 
156
-					if ($usePadding) 
157
-						$i    +=    $width%4; 
156
+					if ($usePadding) {
157
+											$i    +=    $width%4;
158
+					}
158 159
 					
159 160
 					//    Reset horizontal position 
160 161
 					$x    =    0; 
@@ -163,8 +164,9 @@  discard block
 block discarded – undo
163 164
 					$y++; 
164 165
 					
165 166
 					//    Reached the image-height? Break the for-loop 
166
-					if ($y>$height) 
167
-						break; 
167
+					if ($y>$height) {
168
+											break;
169
+					}
168 170
 				} 
169 171
 				
170 172
 				//    Calculation of the RGB-pixel (defined as BGR in image-data) 
Please login to merge, or discard this patch.
cloudcontrol/library/images/methods/Watermark.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,7 +61,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 		
Please login to merge, or discard this patch.
cloudcontrol/library/images/methods/BoxCrop.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,9 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 		/**
18 18
 		 * @param resource $imageResource
19 19
 		 * @return resource
20
-         */
20
+		 */
21 21
 		public function Execute($imageResource)
22 22
 		{
23 23
 			// Define the origial width and height
Please login to merge, or discard this patch.
cloudcontrol/library/images/methods/SmartCrop.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,8 +62,8 @@
 block discarded – undo
62 62
 
63 63
 			// Preserve transparency
64 64
 			imagecolortransparent($new, imagecolorallocatealpha($new, 0, 0, 0, 127));
65
-            imagealphablending($new, false);
66
-            imagesavealpha($new, true);
65
+			imagealphablending($new, false);
66
+			imagesavealpha($new, true);
67 67
 			
68 68
 			imagecopyresampled($new, $imageResource, $this->_destX, $this->_destY, $this->_x, $this->_y, $this->_destWidth, $this->_destHeight, $originalWidth, $originalHeight);
69 69
 			
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,9 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
cloudcontrol/library/cc/cc.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -61,12 +61,15 @@
 block discarded – undo
61 61
 }
62 62
 
63 63
 function humanFileSize($size,$unit="") {
64
-	if( (!$unit && $size >= 1<<30) || $unit == "GB")
65
-		return number_format($size/(1<<30),2)."GB";
66
-	if( (!$unit && $size >= 1<<20) || $unit == "MB")
67
-		return number_format($size/(1<<20),2)."MB";
68
-	if( (!$unit && $size >= 1<<10) || $unit == "KB")
69
-		return number_format($size/(1<<10),2)."KB";
64
+	if( (!$unit && $size >= 1<<30) || $unit == "GB") {
65
+			return number_format($size/(1<<30),2)."GB";
66
+	}
67
+	if( (!$unit && $size >= 1<<20) || $unit == "MB") {
68
+			return number_format($size/(1<<20),2)."MB";
69
+	}
70
+	if( (!$unit && $size >= 1<<10) || $unit == "KB") {
71
+			return number_format($size/(1<<10),2)."KB";
72
+	}
70 73
 	return number_format($size)." bytes";
71 74
 }
72 75
 
Please login to merge, or discard this patch.
cloudcontrol/library/images/methods/Crop.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,8 +62,8 @@
 block discarded – undo
62 62
 
63 63
 			// Preserve transparency
64 64
 			imagecolortransparent($new, imagecolorallocatealpha($new, 0, 0, 0, 127));
65
-            imagealphablending($new, false);
66
-            imagesavealpha($new, true);
65
+			imagealphablending($new, false);
66
+			imagesavealpha($new, true);
67 67
 			
68 68
 			imagecopyresampled($new, $imageResource, $this->_destX, $this->_destY, $this->_x, $this->_y, $this->_destWidth, $this->_destHeight, $originalWidth, $originalHeight);
69 69
 			
Please login to merge, or discard this patch.
cloudcontrol/library/storage/JsonStorage.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
 		/**
787 787
 		 * @param $filename
788 788
 		 * @return null
789
-         */
789
+		 */
790 790
 		public function getImageByName($filename)
791 791
 		{
792 792
 			$images = $this->getImages();
@@ -876,7 +876,7 @@  discard block
 block discarded – undo
876 876
 		/**
877 877
 		 * @param $filename
878 878
 		 * @return null
879
-         */
879
+		 */
880 880
 		public function getFileByName($filename)
881 881
 		{
882 882
 			$files = $this->getFiles();
@@ -891,7 +891,7 @@  discard block
 block discarded – undo
891 891
 		/**
892 892
 		 * @param $filename
893 893
 		 * @throws \Exception
894
-         */
894
+		 */
895 895
 		public function deleteFileByName($filename)
896 896
 		{
897 897
 			$destinationPath = realpath(__DIR__ . '/../../www/files/');
Please login to merge, or discard this patch.
cloudcontrol/library/components/CmsComponent.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
 		/**
20 20
 		 * @var null
21
-         */
21
+		 */
22 22
 		protected $subTemplate = null;
23 23
 
24 24
 		/**
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 		/**
140 140
 		 * @param $remoteAddress
141 141
 		 * @throws \Exception
142
-         */
142
+		 */
143 143
 		private function checkWhiteList($remoteAddress)
144 144
 		{
145 145
 			if (isset($this->parameters['whitelistIps'])) {
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 		/**
155 155
 		 * @param $remoteAddress
156 156
 		 * @throws \Exception
157
-         */
157
+		 */
158 158
 		private function checkBlackList($remoteAddress)
159 159
 		{
160 160
 			if (isset($this->parameters['blacklistIps'])) {
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 		/**
170 170
 		 * @param $request
171 171
 		 * @return mixed|string
172
-         */
172
+		 */
173 173
 		private function getRelativeCmsUri($request)
174 174
 		{
175 175
 			// TODO Use regex match parameter instead of calculating relative uri
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 		/**
185 185
 		 * @param $request
186 186
 		 * @param $relativeCmsUri
187
-         */
187
+		 */
188 188
 		private function documentsRouting($request, $relativeCmsUri)
189 189
 		{
190 190
 			if ($relativeCmsUri == '/documents') {
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 		/**
200 200
 		 * @param $request
201 201
 		 * @param $relativeCmsUri
202
-         */
202
+		 */
203 203
 		private function sitemapRouting($request, $relativeCmsUri)
204 204
 		{
205 205
 			if ($relativeCmsUri == '/sitemap') {
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 		/**
238 238
 		 * @param $request
239 239
 		 * @param $relativeCmsUri
240
-         */
240
+		 */
241 241
 		private function imagesRouting($request, $relativeCmsUri)
242 242
 		{
243 243
 			if ($relativeCmsUri == '/images') {
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 
270 270
 		/**
271 271
 		 * @param $relativeCmsUri
272
-         */
272
+		 */
273 273
 		private function apiRouting($relativeCmsUri)
274 274
 		{
275 275
 			if ($relativeCmsUri == '/images.json') {
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 		/**
288 288
 		 * @param $request
289 289
 		 * @param $relativeCmsUri
290
-         */
290
+		 */
291 291
 		private function filesRouting($request, $relativeCmsUri)
292 292
 		{
293 293
 			if ($relativeCmsUri == '/files') {
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 
314 314
 		/**
315 315
 		 * @param $slug
316
-         */
316
+		 */
317 317
 		private function downloadFile($slug)
318 318
 		{
319 319
 			$file = $this->storage->getFileByName($slug);
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 		/**
339 339
 		 * @param $request
340 340
 		 * @param $relativeCmsUri
341
-         */
341
+		 */
342 342
 		private function configurationRouting($request, $relativeCmsUri)
343 343
 		{
344 344
 			if ($relativeCmsUri == '/configuration') {
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 		 * @param $request
358 358
 		 * @param $relativeCmsUri
359 359
 		 * @throws \Exception
360
-         */
360
+		 */
361 361
 		private function documentRouting($request, $relativeCmsUri)
362 362
 		{
363 363
 			if ($relativeCmsUri == '/documents/new-document' && isset($request::$get['path'])) {
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 		/**
413 413
 		 * @param $request
414 414
 		 * @param $relativeCmsUri
415
-         */
415
+		 */
416 416
 		private function folderRouting($request, $relativeCmsUri)
417 417
 		{
418 418
 			if ($relativeCmsUri == '/documents/new-folder' && isset($request::$get['path'])) {
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 		/**
454 454
 		 * @param $request
455 455
 		 * @param $relativeCmsUri
456
-         */
456
+		 */
457 457
 		private function usersRouting($request, $relativeCmsUri)
458 458
 		{
459 459
 			if ($relativeCmsUri == '/configuration/users') {
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
 		/**
488 488
 		 * @param $request
489 489
 		 * @param $relativeCmsUri
490
-         */
490
+		 */
491 491
 		private function documentTypesRouting($request, $relativeCmsUri)
492 492
 		{
493 493
 			if ($relativeCmsUri == '/configuration/document-types') {
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
 		/**
527 527
 		 * @param $request
528 528
 		 * @param $relativeCmsUri
529
-         */
529
+		 */
530 530
 		private function bricksRouting($request, $relativeCmsUri)
531 531
 		{
532 532
 			if ($relativeCmsUri == '/configuration/bricks') {
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
 		/**
566 566
 		 * @param $request
567 567
 		 * @param $relativeCmsUri
568
-         */
568
+		 */
569 569
 		private function imageSetRouting($request, $relativeCmsUri)
570 570
 		{
571 571
 			if ($relativeCmsUri == '/configuration/image-set') {
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
 		/**
601 601
 		 * @param $request
602 602
 		 * @param $relativeCmsUri
603
-         */
603
+		 */
604 604
 		private function applicationComponentRouting($request, $relativeCmsUri)
605 605
 		{
606 606
 			if ($relativeCmsUri == '/configuration/application-components') {
Please login to merge, or discard this patch.