Passed
Push — master ( b64db2...8c639f )
by Jens
02:21
created
src/images/methods/Resize.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
 			
64 64
 			// Define the ratio and adjust the width and height
65 65
 			if ($this->_preserveAspectRatio) {
66
-				$ratio = min($this->_width/$originalWidth, $this->_height/$originalHeight);
66
+				$ratio = min($this->_width / $originalWidth, $this->_height / $originalHeight);
67 67
 				$this->_width = $originalWidth * $ratio;
68 68
 				$this->_height = $originalHeight * $ratio;
69 69
 			}
Please login to merge, or discard this patch.
src/images/methods/BoxCrop.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,14 +26,14 @@
 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) $ratio = 1;
30 30
 			
31 31
 			// Define sizes
32 32
 			$this->_destWidth = floor($originalWidth * $ratio);
33 33
 			$this->_destHeight = floor($originalHeight * $ratio);
34 34
 			
35 35
 			// Define margins
36
-			$this->_destX = floor(($this->_width  - $this->_destWidth) / 2);
36
+			$this->_destX = floor(($this->_width - $this->_destWidth) / 2);
37 37
 			$this->_destY = floor(($this->_height - $this->_destHeight) / 2);
38 38
 			
39 39
 			// Execute the Crop method with the given parameters
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,9 @@
 block discarded – undo
28 28
 			
29 29
 			// Define which ratio will be used, depending on which is the smallest side
30 30
 			$ratio = min($hRatio, $wRatio);
31
-			if($ratio > 1) $ratio = 1;
31
+			if($ratio > 1) {
32
+			    $ratio = 1;
33
+			}
32 34
 			
33 35
 			// Define sizes
34 36
 			$this->_destWidth = floor($originalWidth * $ratio);
Please login to merge, or discard this patch.
src/cc/StringUtil.php 2 patches
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -78,12 +78,15 @@
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/search/filters/DutchStopWords.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,5 +10,5 @@
 block discarded – undo
10 10
 
11 11
 class DutchStopWords extends StopWordsFilter
12 12
 {
13
-	protected $stopWords = array('aan','af','al','alles','als','altijd','andere','ben','bij','daar','dan','dat','de','der','deze','die','dit','doch','doen','door','doorgaans','dus','een','eens','en','er','ge','geen','geweest','haar','had','heb','hebben','heeft','hem','het','hier','hij','hoe','hun','iemand','iets','ik','in','is','ja','je','kan','kon','kunnen','maar','me','meer','men','met','mij','mijn','moet','na','naar','niet','niets','nog','nu','of','om','omdat','ons','ook','op','over','reeds','te','tegen','toch','toen','tot','u','uit','uw','van','veel','voor','want','waren','was','wat','we','wel','werd','wezen','wie','wij','wil','worden','zal','ze','zei','zelf','zich','zij','zijn','zo','zodat','zonder','zou');
13
+	protected $stopWords = array('aan', 'af', 'al', 'alles', 'als', 'altijd', 'andere', 'ben', 'bij', 'daar', 'dan', 'dat', 'de', 'der', 'deze', 'die', 'dit', 'doch', 'doen', 'door', 'doorgaans', 'dus', 'een', 'eens', 'en', 'er', 'ge', 'geen', 'geweest', 'haar', 'had', 'heb', 'hebben', 'heeft', 'hem', 'het', 'hier', 'hij', 'hoe', 'hun', 'iemand', 'iets', 'ik', 'in', 'is', 'ja', 'je', 'kan', 'kon', 'kunnen', 'maar', 'me', 'meer', 'men', 'met', 'mij', 'mijn', 'moet', 'na', 'naar', 'niet', 'niets', 'nog', 'nu', 'of', 'om', 'omdat', 'ons', 'ook', 'op', 'over', 'reeds', 'te', 'tegen', 'toch', 'toen', 'tot', 'u', 'uit', 'uw', 'van', 'veel', 'voor', 'want', 'waren', 'was', 'wat', 'we', 'wel', 'werd', 'wezen', 'wie', 'wij', 'wil', 'worden', 'zal', 'ze', 'zei', 'zelf', 'zich', 'zij', 'zijn', 'zo', 'zodat', 'zonder', 'zou');
14 14
 }
15 15
\ No newline at end of file
Please login to merge, or discard this patch.
src/search/CharacterFilter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 		$string = strip_tags($string);
49 49
 		$string = trim($string);
50 50
 		$string = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $string); // Remove special alphanumeric characters
51
-		$string = str_replace(array('+', '=', '!', ',', '.',';', ':', '?'), ' ', $string); // Replace sentence breaking charaters with spaces
51
+		$string = str_replace(array('+', '=', '!', ',', '.', ';', ':', '?'), ' ', $string); // Replace sentence breaking charaters with spaces
52 52
 		$string = preg_replace("/[\r\n]+/", " ", $string); // Replace multiple newlines with a single space.
53 53
 		$string = preg_replace("/[\t]+/", " ", $string); // Replace multiple tabs with a single space.
54 54
 		$string = preg_replace("/[^a-zA-Z0-9 ]/", '', $string); // Filter out everything that is not alphanumeric or a space
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	{
67 67
 		$encoding = mb_detect_encoding($string, mb_detect_order(), false);
68 68
 
69
-		if($encoding == "UTF-8") {
69
+		if ($encoding == "UTF-8") {
70 70
 			$string = mb_convert_encoding($string, 'UTF-8', 'UTF-8');
71 71
 		}
72 72
 
Please login to merge, or discard this patch.
src/images/methods/Watermark.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -63,7 +63,9 @@  discard block
 block discarded – undo
63 63
 		 */
64 64
 		protected function calculateX($imageResource)
65 65
 		{
66
-			if (intval($this->_x) === $this->_x) return $this->_x;
66
+			if (intval($this->_x) === $this->_x) {
67
+			    return $this->_x;
68
+			}
67 69
 			
68 70
 			$x = strtolower($this->_x);
69 71
 			
@@ -88,7 +90,9 @@  discard block
 block discarded – undo
88 90
 		 */
89 91
 		public function calculateY($imageResource)
90 92
 		{
91
-			if (intval($this->_y) === $this->_y) return $this->_y;
93
+			if (intval($this->_y) === $this->_y) {
94
+			    return $this->_y;
95
+			}
92 96
 		
93 97
 			$y = strtolower($this->_y);
94 98
 			
@@ -125,7 +129,9 @@  discard block
 block discarded – undo
125 129
 		 */
126 130
 		public function GetWatermark()
127 131
 		{
128
-			if ($this->_watermark == null) throw new \Exception('A watermark is not set. Please supply a \CloudControl\Cms\image\Image using $this->SetWatermark');
132
+			if ($this->_watermark == null) {
133
+			    throw new \Exception('A watermark is not set. Please supply a \CloudControl\Cms\image\Image using $this->SetWatermark');
134
+			}
129 135
 			return $this->_watermark;
130 136
 		}
131 137
 		
Please login to merge, or discard this patch.
src/images/methods/SmartCrop.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,9 @@
 block discarded – undo
38 38
 			
39 39
 			// Define which ratio will be used, depending on which is the biggest side
40 40
 			$ratio = $wRatio < $hRatio ? $wRatio : $hRatio;
41
-			if ($ratio < 1) $ratio = 1;
41
+			if ($ratio < 1) {
42
+			    $ratio = 1;
43
+			}
42 44
 			
43 45
 			// Calculate the destination width, height, x and y
44 46
 			$this->_destWidth = $originalWidth / $ratio;
Please login to merge, or discard this patch.
src/templates/documents/brick.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,8 +14,10 @@
 block discarded – undo
14 14
 				<? if (isset($dynamicBrick)) :
15 15
 					$fieldSlug = $field->slug;
16 16
 					$value = isset($dynamicBrick->fields->$fieldSlug) ? current($dynamicBrick->fields->$fieldSlug) : '';
17
-				else :
17
+				else {
18
+				    :
18 19
 					$value = '';
20
+				}
19 21
 				endif ?>
20 22
 				<? if ($field->multiple == true && $field->type != 'Rich Text') : ?>
21 23
 				<ul class="grid-wrapper sortable">
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 								</div>
64 64
 							</div>
65 65
 						</li>
66
-						<?$value='';?>
66
+						<?$value = ''; ?>
67 67
 						<? endforeach ?>
68 68
 					<? endif ?>
69 69
 				</ul>
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 							<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
84 84
 							</div>
85 85
 						</li>
86
-						<?$value='';?>
86
+						<?$value = ''; ?>
87 87
 					<? endforeach ?>
88 88
 					<? endif ?>
89 89
 					</div>
@@ -92,5 +92,5 @@  discard block
 block discarded – undo
92 92
 				<a class="btn js-addrtemultiple">+</a>
93 93
 				<? endif ?>
94 94
 			</div>
95
-			<?$value='';?>
95
+			<?$value = ''; ?>
96 96
 		<? endforeach ?>
Please login to merge, or discard this patch.
src/templates/documents/document-form-form.php 2 patches
Braces   +16 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@  discard block
 block discarded – undo
1 1
 <form method="<?= isset($documentType) ? 'post' : 'get' ?>" onsubmit="return processRtes();" action="<?= isset($formId) ? '#' . $formId : '' ?>">
2 2
     <? if (!isset($hideTitleAndState)) : ?>
3 3
       <input type="hidden" name="path" value="<?= $request::$get['path'] ?>"/>
4
-    <? else : ?>
4
+    <? else {
5
+    : ?>
5 6
       <input type="hidden" name="formId" value="<?= $formId ?>"/>
6 7
       <a name="<?= $formId ?>"></a>
7 8
     <? endif ?>
@@ -17,15 +18,19 @@  discard block
 block discarded – undo
17 18
                     <input required="required" value="<?=isset($document) ? $document->title : '' ?>" type="text" id="title" name="title" placeholder="Title" />
18 19
                 </div>
19 20
 			<? endif ?>
20
-			<?$fieldPrefix='fields';?>
21
+			<?$fieldPrefix='fields';
22
+}
23
+?>
21 24
 			<? foreach ($documentType->fields as $field) : ?>
22 25
 				<div class="form-element">
23 26
 					<label for="<?=$field->slug?>"><?=$field->title?></label>
24 27
 					<? if (isset($document)) :
25 28
 						$fieldSlug = $field->slug;
26 29
 						$value = isset($document->fields->$fieldSlug) ? current($document->fields->$fieldSlug) : '';
27
-					else :
30
+					else {
31
+					    :
28 32
 						$value = '';
33
+					}
29 34
 					endif ?>
30 35
 					<? if ($field->multiple == true && $field->type != 'Rich Text') : ?>
31 36
 					<ul class="grid-wrapper sortable">
@@ -135,8 +140,11 @@  discard block
 block discarded – undo
135 140
 					</ul>
136 141
 					<a class="btn" onclick="addDynamicBrick(this, 'true', 'newBrickDropzone_<?=$static_brick_nr?>');">+</a>
137 142
 					<?$static_brick_nr += 1?>
138
-				<? else : ?>
139
-					<?$fieldPrefix='bricks[' . $brick->slug . '][fields]';?>
143
+				<? else {
144
+    : ?>
145
+					<?$fieldPrefix='bricks[' . $brick->slug . '][fields]';
146
+}
147
+?>
140 148
 					<input type="hidden" name="bricks[<?=$brick->slug?>][type]" value="<?=$brick->brickSlug?>" />
141 149
 					<? foreach ($brick->structure->fields as $field) : ?>
142 150
 						<div class="form-element">
@@ -145,8 +153,10 @@  discard block
 block discarded – undo
145 153
 							$brickSlug = $brick->slug;
146 154
 							$fieldSlug = $field->slug;
147 155
 							$value = isset($document->bricks->$brickSlug->fields->$fieldSlug) ? current($document->bricks->$brickSlug->fields->$fieldSlug) : '';
148
-						else :
156
+						else {
157
+						    :
149 158
 							$value = '';
159
+						}
150 160
 						endif ?>
151 161
 						<? if ($field->multiple == true && $field->type != 'Rich Text') : ?>
152 162
 						<ul class="grid-wrapper sortable">
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
                     <input required="required" value="<?=isset($document) ? $document->title : '' ?>" type="text" id="title" name="title" placeholder="Title" />
18 18
                 </div>
19 19
 			<? endif ?>
20
-			<?$fieldPrefix='fields';?>
20
+			<?$fieldPrefix = 'fields'; ?>
21 21
 			<? foreach ($documentType->fields as $field) : ?>
22 22
 				<div class="form-element">
23 23
 					<label for="<?=$field->slug?>"><?=$field->title?></label>
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 									</div>
74 74
 								</div>
75 75
 							</li>
76
-							<?$value='';?>
76
+							<?$value = ''; ?>
77 77
 							<? endforeach ?>
78 78
 						<? endif ?>
79 79
 					</ul>
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 								<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
94 94
 								</div>
95 95
 							</li>
96
-							<?$value='';?>
96
+							<?$value = ''; ?>
97 97
 						<? endforeach ?>
98 98
 						<? endif ?>
99 99
 						</div>
@@ -102,17 +102,17 @@  discard block
 block discarded – undo
102 102
 					<a class="btn js-addrtemultiple">+</a>
103 103
 					<? endif ?>
104 104
 				</div>
105
-				<?$value='';?>
105
+				<?$value = ''; ?>
106 106
 			<? endforeach ?>
107 107
 			<hr />
108
-			<? $static_brick_nr = 0;?>
108
+			<? $static_brick_nr = 0; ?>
109 109
 			<? foreach ($documentType->bricks as $brick) : ?>
110 110
 			<div class="brick">
111 111
 				<label><?=$brick->title?></label>
112 112
 				<? if ($brick->multiple == 'true') : ?>
113 113
 					<input type="hidden" value="<?=$brick->brickSlug?>"/>
114 114
 					<input type="hidden" value="<?=$brick->slug?>"/>
115
-					<?$myBrickSlug=$brick->slug;?>
115
+					<?$myBrickSlug = $brick->slug; ?>
116 116
 					<ul id="newBrickDropzone_<?=$static_brick_nr?>" class="dynamicBricks sortable">
117 117
 						<? if (isset($document)) : ?>
118 118
 							<? foreach ($document->bricks as $currentBrickSlug => $brickArray) : ?>
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 					<a class="btn" onclick="addDynamicBrick(this, 'true', 'newBrickDropzone_<?=$static_brick_nr?>');">+</a>
137 137
 					<?$static_brick_nr += 1?>
138 138
 				<? else : ?>
139
-					<?$fieldPrefix='bricks[' . $brick->slug . '][fields]';?>
139
+					<?$fieldPrefix = 'bricks[' . $brick->slug . '][fields]'; ?>
140 140
 					<input type="hidden" name="bricks[<?=$brick->slug?>][type]" value="<?=$brick->brickSlug?>" />
141 141
 					<? foreach ($brick->structure->fields as $field) : ?>
142 142
 						<div class="form-element">
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 										</div>
196 196
 									</div>
197 197
 								</li>
198
-								<?$value='';?>
198
+								<?$value = ''; ?>
199 199
 								<? endforeach ?>
200 200
 							<? endif ?>
201 201
 						</ul>
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 									<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
217 217
 									</div>
218 218
 								</li>
219
-								<?$value='';?>
219
+								<?$value = ''; ?>
220 220
 							<? endforeach ?>
221 221
 							<? endif ?>
222 222
 							</div>
@@ -225,12 +225,12 @@  discard block
 block discarded – undo
225 225
 						<a class="btn js-addrtemultiple">+</a>
226 226
 						<? endif ?>
227 227
 					</div>
228
-					<?$value='';?>
228
+					<?$value = ''; ?>
229 229
 				<? endforeach ?>
230 230
 				<? endif ?>
231 231
 				</div>
232 232
 				<hr />
233
-			<? endforeach;?>
233
+			<? endforeach; ?>
234 234
 
235 235
 
236 236
 
Please login to merge, or discard this patch.