Completed
Branch develop (8d279a)
by
unknown
17:41
created
htdocs/includes/nusoap/lib/nusoap.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6508,15 +6508,13 @@  discard block
 block discarded – undo
6508 6508
                                 $xml .= $this->serializeType ($eName,
6509 6509
                                                               isset($attrs['type']) ? $attrs['type'] : $attrs['ref'],
6510 6510
                                                               $v, $use, $encodingStyle, $unqualified);
6511
-                            }
6512
-                            elseif (isset($attrs['type']) || isset($attrs['ref']))
6511
+                            } elseif (isset($attrs['type']) || isset($attrs['ref']))
6513 6512
                             {
6514 6513
                                 // serialize schema-defined type
6515 6514
                                 $xml .= $this->serializeType ($eName,
6516 6515
                                                               isset($attrs['type']) ? $attrs['type'] : $attrs['ref'],
6517 6516
                                                               $v, $use, $encodingStyle, $unqualified);
6518
-                            }
6519
-                            else
6517
+                            } else
6520 6518
                             {
6521 6519
                                 // serialize generic type (can this ever really happen?)
6522 6520
                                 $this->debug ("calling serialize_val() for $v, $eName, false, false, false, false, $use");
@@ -7018,8 +7016,7 @@  discard block
 block discarded – undo
7018 7016
                     if (isset($this->namespaces[$value_prefix]))
7019 7017
                     {
7020 7018
                         $this->message[$pos]['type_namespace'] = $this->namespaces[$value_prefix];
7021
-                    }
7022
-                    elseif (isset($attrs['xmlns:' . $value_prefix]))
7019
+                    } elseif (isset($attrs['xmlns:' . $value_prefix]))
7023 7020
                     {
7024 7021
                         $this->message[$pos]['type_namespace'] = $attrs['xmlns:' . $value_prefix];
7025 7022
                     }
Please login to merge, or discard this patch.
htdocs/salaries/class/api_salaries.class.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -444,7 +444,9 @@
 block discarded – undo
444 444
 	{
445 445
 		$paymentsalary = array();
446 446
 		$fields = Salaries::$FIELDSPAYMENT;
447
-		if (isModEnabled("bank")) array_push($fields, "accountid");
447
+		if (isModEnabled("bank")) {
448
+			array_push($fields, "accountid");
449
+		}
448 450
 		foreach ($fields as $field) {
449 451
 			if (!isset($data[$field])) {
450 452
 				throw new RestException(400, "$field field missing");
Please login to merge, or discard this patch.
htdocs/public/webportal/logout.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,9 @@
 block discarded – undo
48 48
 }
49 49
 
50 50
 // Not sure this is required
51
-if (isset($_SESSION['webportal_logged_thirdparty_account_id'])) unset($_SESSION['webportal_logged_thirdparty_account_id']);
51
+if (isset($_SESSION['webportal_logged_thirdparty_account_id'])) {
52
+	unset($_SESSION['webportal_logged_thirdparty_account_id']);
53
+}
52 54
 
53 55
 if (GETPOST('noredirect')) {
54 56
 	return;
Please login to merge, or discard this patch.
htdocs/includes/odtphp/odf.php 1 patch
Braces   +31 added lines, -11 removed lines patch added patch discarded remove patch
@@ -78,7 +78,10 @@  discard block
 block discarded – undo
78 78
 		}
79 79
 
80 80
 		$md5uniqid = md5(uniqid());
81
-		if ($this->config['PATH_TO_TMP']) $this->tmpdir = preg_replace('|[\/]$|', '', $this->config['PATH_TO_TMP']);	// Remove last \ or /
81
+		if ($this->config['PATH_TO_TMP']) {
82
+			$this->tmpdir = preg_replace('|[\/]$|', '', $this->config['PATH_TO_TMP']);
83
+		}
84
+		// Remove last \ or /
82 85
 		$this->tmpdir .= ($this->tmpdir?'/':'').$md5uniqid;
83 86
 		$this->tmpfile = $this->tmpdir.'/'.$md5uniqid.'.odt';	// We keep .odt extension to allow OpenOffice usage during debug.
84 87
 
@@ -94,7 +97,9 @@  discard block
 block discarded – undo
94 97
 
95 98
 		// Load zip proxy
96 99
 		$zipHandler = $this->config['ZIP_PROXY'];
97
-		if (!defined('PCLZIP_TEMPORARY_DIR')) define('PCLZIP_TEMPORARY_DIR', $this->tmpdir);
100
+		if (!defined('PCLZIP_TEMPORARY_DIR')) {
101
+			define('PCLZIP_TEMPORARY_DIR', $this->tmpdir);
102
+		}
98 103
 		include_once 'zip/'.$zipHandler.'.php';
99 104
 		if (! class_exists($this->config['ZIP_PROXY'])) {
100 105
 			throw new OdfException($this->config['ZIP_PROXY'] . ' class not found - check your php settings');
@@ -236,8 +241,12 @@  discard block
 block discarded – undo
236 241
 	 */
237 242
 	private function _replaceHtmlWithOdtTag($tags, &$customStyles, &$fontDeclarations, $encode = false, $charset = '')
238 243
 	{
239
-		if ($customStyles == null) $customStyles = array();
240
-		if ($fontDeclarations == null) $fontDeclarations = array();
244
+		if ($customStyles == null) {
245
+			$customStyles = array();
246
+		}
247
+		if ($fontDeclarations == null) {
248
+			$fontDeclarations = array();
249
+		}
241 250
 
242 251
 		$odtResult = '';
243 252
 
@@ -556,10 +565,15 @@  discard block
 block discarded – undo
556 565
 	 */
557 566
 	private function _parse($type = 'content')
558 567
 	{
559
-		if ($type == 'content') $xml = &$this->contentXml;
560
-		elseif ($type == 'styles') $xml = &$this->stylesXml;
561
-		elseif ($type == 'meta') $xml = &$this->metaXml;
562
-		else return;
568
+		if ($type == 'content') {
569
+			$xml = &$this->contentXml;
570
+		} elseif ($type == 'styles') {
571
+			$xml = &$this->stylesXml;
572
+		} elseif ($type == 'meta') {
573
+			$xml = &$this->metaXml;
574
+		} else {
575
+			return;
576
+		}
563 577
 
564 578
 		// Search all tags found into condition to complete $this->vars, so we will proceed all tests even if not defined
565 579
 		$reg='@\[!--\sIF\s([{}a-zA-Z0-9\.\,_]+)\s--\]@smU';
@@ -600,7 +614,9 @@  discard block
 block discarded – undo
600 614
 				$reg = '@\[!--\sIF\s' . $key . '\s--\](.*)(\[!--\sELSE\s' . $key . '\s--\](.*))?\[!--\sENDIF\s' . $key . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
601 615
 				preg_match_all($reg, $xml, $matches, PREG_SET_ORDER);
602 616
 				foreach ($matches as $match) { // For each match, if there is an ELSE clause, we replace the whole block by the value in the ELSE clause
603
-					if (!empty($match[3])) $xml = str_replace($match[0], $match[3], $xml);
617
+					if (!empty($match[3])) {
618
+						$xml = str_replace($match[0], $match[3], $xml);
619
+					}
604 620
 				}
605 621
 				// Cleanup the other conditional blocks (all the others where there were no ELSE clause, we can just remove them altogether)
606 622
 				$xml = preg_replace($reg, '', $xml);
@@ -754,7 +770,9 @@  discard block
 block discarded – undo
754 770
 	 */
755 771
 	public function setMetaData()
756 772
 	{
757
-		if (empty($this->creator)) $this->creator='';
773
+		if (empty($this->creator)) {
774
+			$this->creator='';
775
+		}
758 776
 
759 777
 		$this->metaXml = preg_replace('/<dc:date>.*<\/dc:date>/', '<dc:date>'.gmdate("Y-m-d\TH:i:s").'</dc:date>', $this->metaXml);
760 778
 		$this->metaXml = preg_replace('/<dc:creator>.*<\/dc:creator>/', '<dc:creator>'.htmlspecialchars($this->creator).'</dc:creator>', $this->metaXml);
@@ -822,7 +840,9 @@  discard block
 block discarded – undo
822 840
 	{
823 841
 		global $conf;
824 842
 
825
-		if ( $name == "" ) $name = "temp".md5(uniqid());
843
+		if ( $name == "" ) {
844
+			$name = "temp".md5(uniqid());
845
+		}
826 846
 
827 847
 		dol_syslog(get_class($this).'::exportAsAttachedPDF $name='.$name, LOG_DEBUG);
828 848
 		$this->saveToDisk($name);
Please login to merge, or discard this patch.
htdocs/includes/restler/framework/Luracast/Restler/AutoLoader.php 1 patch
Braces   +92 added lines, -59 removed lines patch added patch discarded remove patch
@@ -52,9 +52,11 @@  discard block
 block discarded – undo
52 52
 		 */
53 53
 		public static function addPath($path)
54 54
 		{
55
-			if (false === $path = stream_resolve_include_path($path))
56
-			return false;
57
-			else set_include_path($path.PATH_SEPARATOR.get_include_path());
55
+			if (false === $path = stream_resolve_include_path($path)) {
56
+						return false;
57
+			} else {
58
+				set_include_path($path.PATH_SEPARATOR.get_include_path());
59
+			}
58 60
 			return $path;
59 61
 		}
60 62
 
@@ -67,16 +69,19 @@  discard block
 block discarded – undo
67 69
 		 */
68 70
 		public static function thereCanBeOnlyOne()
69 71
 		{
70
-			if (static::$perfectLoaders === spl_autoload_functions())
71
-			return static::$instance;
72
+			if (static::$perfectLoaders === spl_autoload_functions()) {
73
+						return static::$instance;
74
+			}
72 75
 
73
-			if (false !== $loaders = spl_autoload_functions())
74
-			if (0 < $count = count($loaders))
76
+			if (false !== $loaders = spl_autoload_functions()) {
77
+						if (0 < $count = count($loaders))
75 78
 				for ($i = 0, static::$rogueLoaders += $loaders;
79
+			}
76 80
 					 $i < $count && false != ($loader = $loaders[$i]);
77
-					 $i++)
78
-					if ($loader !== static::$perfectLoaders[0])
81
+					 $i++) {
82
+									if ($loader !== static::$perfectLoaders[0])
79 83
 						spl_autoload_unregister($loader);
84
+				}
80 85
 
81 86
 			return static::$instance;
82 87
 		}
@@ -105,12 +110,14 @@  discard block
 block discarded – undo
105 110
 				return false;
106 111
 			}
107 112
 
108
-			if (empty(static::$classMap[$key]))
109
-			static::$classMap[$key] = $value;
113
+			if (empty(static::$classMap[$key])) {
114
+						static::$classMap[$key] = $value;
115
+			}
110 116
 
111
-			if (is_string($alias = static::$classMap[$key]))
112
-			if (isset(static::$classMap[$alias]))
117
+			if (is_string($alias = static::$classMap[$key])) {
118
+						if (isset(static::$classMap[$alias]))
113 119
 				return static::$classMap[$alias];
120
+			}
114 121
 
115 122
 			return static::$classMap[$key];
116 123
 		}
@@ -138,8 +145,8 @@  discard block
 block discarded – undo
138 145
 					array($dir, 'vendor', 'composer'),
139 146
 					array($dir, '..', '..', '..', 'php'),
140 147
 					array($dir, 'vendor', 'php'))
141
-				as $includePath)
142
-				if (false !== $path = stream_resolve_include_path(
148
+				as $includePath) {
149
+								if (false !== $path = stream_resolve_include_path(
143 150
 						implode($slash, $includePath)
144 151
 					))
145 152
 				if ('composer' == end($includePath) &&
@@ -150,18 +157,22 @@  discard block
 block discarded – undo
150 157
 					static::seen(static::loadFile(
151 158
 						$classmapPath
152 159
 					));
160
+				}
153 161
 					$paths = array_merge(
154 162
 						$paths,
155 163
 						array_values(static::loadFile(
156 164
 							"$path{$slash}autoload_namespaces.php"
157 165
 						))
158 166
 					);
159
-				} else $paths[] = $path;
167
+				} else {
168
+					$paths[] = $path;
169
+				}
160 170
 
161 171
 				$paths = array_filter(array_map(
162 172
 				function ($path) {
163
-					if (false == $realPath = @realpath($path))
164
-						return null;
173
+					if (false == $realPath = @realpath($path)) {
174
+											return null;
175
+					}
165 176
 					return $realPath . DIRECTORY_SEPARATOR;
166 177
 				},
167 178
 				$paths
@@ -200,9 +211,11 @@  discard block
 block discarded – undo
200 211
 		private function loadPrefixes($className)
201 212
 		{
202 213
 			$currentClass = $className;
203
-			if (false !== $pos = strrpos($className, '\\'))
204
-			$className = substr($className, $pos);
205
-			else $className = "\\$className";
214
+			if (false !== $pos = strrpos($className, '\\')) {
215
+						$className = substr($className, $pos);
216
+			} else {
217
+				$className = "\\$className";
218
+			}
206 219
 
207 220
 			for (
208 221
 			$i = 0,
@@ -231,12 +244,13 @@  discard block
 block discarded – undo
231 244
 		private function loadAliases($className)
232 245
 		{
233 246
 			$file = false;
234
-			if (preg_match('/(.+)(\\\\\w+$)/U', $className, $parts))
235
-			for (
247
+			if (preg_match('/(.+)(\\\\\w+$)/U', $className, $parts)) {
248
+						for (
236 249
 				$i = 0,
237 250
 				$aliases = isset(static::$aliases[$parts[1]])
238 251
 					? static::$aliases[$parts[1]] : array(),
239 252
 				$count = count($aliases);
253
+			}
240 254
 				$i < $count && false === $file;
241 255
 				$file = $this->discover(
242 256
 					"{$aliases[$i++]}$parts[2]",
@@ -263,13 +277,15 @@  discard block
 block discarded – undo
263 277
 		{
264 278
 			$loaders = array_unique(static::$rogueLoaders, SORT_REGULAR);
265 279
 			if (isset($loader)) {
266
-				if (false === array_search($loader, $loaders))
267
-				static::$rogueLoaders[] = $loader;
280
+				if (false === array_search($loader, $loaders)) {
281
+								static::$rogueLoaders[] = $loader;
282
+				}
268 283
 				return $this->loadThisLoader($className, $loader);
269 284
 			}
270
-			foreach ($loaders as $loader)
271
-				if (false !== $file = $this->loadThisLoader($className, $loader))
285
+			foreach ($loaders as $loader) {
286
+							if (false !== $file = $this->loadThisLoader($className, $loader))
272 287
 					return $file;
288
+			}
273 289
 
274 290
 			return false;
275 291
 		}
@@ -342,13 +358,18 @@  discard block
 block discarded – undo
342 358
 		 */
343 359
 		private function alias($className, $currentClass)
344 360
 		{
345
-			if ($className == 'Luracast\Restler\string') return;
346
-			if ($className == 'Luracast\Restler\mixed') return;
361
+			if ($className == 'Luracast\Restler\string') {
362
+				return;
363
+			}
364
+			if ($className == 'Luracast\Restler\mixed') {
365
+				return;
366
+			}
347 367
 			if ($className != $currentClass
348
-			&& false !== strpos($className, $currentClass))
349
-				if (!class_exists($currentClass, false)
368
+			&& false !== strpos($className, $currentClass)) {
369
+							if (!class_exists($currentClass, false)
350 370
 					&& class_alias($className, $currentClass))
351 371
 						static::seen($currentClass, $className);
372
+			}
352 373
 		}
353 374
 
354 375
 		/**
@@ -366,11 +387,12 @@  discard block
 block discarded – undo
366 387
 
367 388
 			/** The short version we've done this before and found it in cache */
368 389
 			if (false !== $file = static::seen($className)) {
369
-				if (!$this->exists($className))
370
-				if (is_callable($file))
390
+				if (!$this->exists($className)) {
391
+								if (is_callable($file))
371 392
 					$file = $this->loadLastResort($className, $file);
372
-				elseif ($file = stream_resolve_include_path($file))
373
-					$file = static::loadFile($file);
393
+				} elseif ($file = stream_resolve_include_path($file)) {
394
+									$file = static::loadFile($file);
395
+				}
374 396
 
375 397
 				$this->alias($className, $currentClass);
376 398
 				return $file;
@@ -380,15 +402,17 @@  discard block
 block discarded – undo
380 402
 
381 403
 			/** replace \ with / and _ in CLASS NAME with / = PSR-0 in 3 lines */
382 404
 			$file = preg_replace("/\\\|_(?=\w+$)/", DIRECTORY_SEPARATOR, $className);
383
-			if (false === $file = stream_resolve_include_path("$file.php"))
384
-			return false;
405
+			if (false === $file = stream_resolve_include_path("$file.php")) {
406
+						return false;
407
+			}
385 408
 
386 409
 			/** have we loaded this file before could this be an alias */
387 410
 			if (in_array($file, get_included_files())) {
388
-				if (false !== $sameFile = array_search($file, static::$classMap))
389
-				if (!$this->exists($className, $file))
411
+				if (false !== $sameFile = array_search($file, static::$classMap)) {
412
+								if (!$this->exists($className, $file))
390 413
 					if (false !== strpos($sameFile, $className))
391 414
 						$this->alias($sameFile, $className);
415
+				}
392 416
 
393 417
 				return $file;
394 418
 			}
@@ -396,17 +420,19 @@  discard block
 block discarded – undo
396 420
 			$state = array_merge(get_declared_classes(), get_declared_interfaces());
397 421
 
398 422
 			if (false !== $result = static::loadFile($file)) {
399
-				if ($this->exists($className, $file))
400
-				$this->alias($className, $currentClass);
401
-				elseif (false != $diff = array_diff(
402
-				array_merge(get_declared_classes(), get_declared_interfaces()), $state))
403
-				foreach ($diff as $autoLoaded)
423
+				if ($this->exists($className, $file)) {
424
+								$this->alias($className, $currentClass);
425
+				} elseif (false != $diff = array_diff(
426
+				array_merge(get_declared_classes(), get_declared_interfaces()), $state)) {
427
+								foreach ($diff as $autoLoaded)
404 428
 					if ($this->exists($autoLoaded, $file))
405 429
 						if (false !== strpos($autoLoaded, $className))
406 430
 							$this->alias($autoLoaded, $className);
431
+				}
407 432
 
408
-				if (!$this->exists($currentClass))
409
-				$result = false;
433
+				if (!$this->exists($currentClass)) {
434
+								$result = false;
435
+				}
410 436
 			}
411 437
 
412 438
 			return $result;
@@ -424,10 +450,12 @@  discard block
 block discarded – undo
424 450
 		private function exists($className, $mapping = null)
425 451
 		{
426 452
 			if (class_exists($className, false)
427
-			|| interface_exists($className, false))
428
-			if (isset($mapping))
453
+			|| interface_exists($className, false)) {
454
+						if (isset($mapping))
429 455
 				return static::seen($className, $mapping);
430
-			else return true;
456
+			} else {
457
+				return true;
458
+			}
431 459
 			return false;
432 460
 		}
433 461
 
@@ -440,22 +468,27 @@  discard block
 block discarded – undo
440 468
 		 */
441 469
 		public function __invoke($className)
442 470
 		{
443
-			if (empty($className))
444
-			return false;
471
+			if (empty($className)) {
472
+						return false;
473
+			}
445 474
 
446
-			if (false !== $includeReference = $this->discover($className))
447
-			return $includeReference;
475
+			if (false !== $includeReference = $this->discover($className)) {
476
+						return $includeReference;
477
+			}
448 478
 
449 479
 			//static::thereCanBeOnlyOne();
450 480
 
451
-			if (false !== $includeReference = $this->loadAliases($className))
452
-			return $includeReference;
481
+			if (false !== $includeReference = $this->loadAliases($className)) {
482
+						return $includeReference;
483
+			}
453 484
 
454
-			if (false !== $includeReference = $this->loadPrefixes($className))
455
-			return $includeReference;
485
+			if (false !== $includeReference = $this->loadPrefixes($className)) {
486
+						return $includeReference;
487
+			}
456 488
 
457
-			if (false !== $includeReference = $this->loadLastResort($className))
458
-				return $includeReference;
489
+			if (false !== $includeReference = $this->loadLastResort($className)) {
490
+							return $includeReference;
491
+			}
459 492
 
460 493
 			static::seen($className, true);
461 494
 			return null;
Please login to merge, or discard this patch.
htdocs/includes/geoPHP/lib/geometry/Geometry.class.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,9 @@
 block discarded – undo
60 60
 
61 61
 	public function envelope()
62 62
 	{
63
-		if ($this->isEmpty()) return new Polygon();
63
+		if ($this->isEmpty()) {
64
+			return new Polygon();
65
+		}
64 66
 
65 67
 		if ($this->geos()) {
66 68
 			return geoPHP::geosToGeometry($this->geos()->envelope());
Please login to merge, or discard this patch.
htdocs/includes/geoPHP/lib/geometry/Collection.class.php 1 patch
Braces   +18 added lines, -7 removed lines patch added patch discarded remove patch
@@ -53,14 +53,17 @@  discard block
 block discarded – undo
53 53
 	public function invertxy()
54 54
 	{
55 55
 		for ($i=0;$i<count($this->components);$i++) {
56
-			if ( method_exists($this->components[$i], 'invertxy') )
57
-			$this->components[$i]->invertxy();
56
+			if ( method_exists($this->components[$i], 'invertxy') ) {
57
+						$this->components[$i]->invertxy();
58
+			}
58 59
 		}
59 60
 	}
60 61
 
61 62
 	public function centroid()
62 63
 	{
63
-		if ($this->isEmpty()) return null;
64
+		if ($this->isEmpty()) {
65
+			return null;
66
+		}
64 67
 
65 68
 		if ($this->geos()) {
66 69
 			$geos_centroid = $this->geos()->centroid();
@@ -79,7 +82,9 @@  discard block
 block discarded – undo
79 82
 
80 83
 	public function getBBox()
81 84
 	{
82
-		if ($this->isEmpty()) return null;
85
+		if ($this->isEmpty()) {
86
+			return null;
87
+		}
83 88
 
84 89
 		if ($this->geos()) {
85 90
 			$envelope = $this->geos()->envelope();
@@ -150,7 +155,9 @@  discard block
 block discarded – undo
150 155
 	// By default, the boundary of a collection is the boundary of it's components
151 156
 	public function boundary()
152 157
 	{
153
-		if ($this->isEmpty()) return new LineString();
158
+		if ($this->isEmpty()) {
159
+			return new LineString();
160
+		}
154 161
 
155 162
 		if ($this->geos()) {
156 163
 			return $this->geos()->boundary();
@@ -224,7 +231,9 @@  discard block
 block discarded – undo
224 231
 			return true;
225 232
 		} else {
226 233
 			foreach ($this->components as $component) {
227
-				if (!$component->isEmpty()) return false;
234
+				if (!$component->isEmpty()) {
235
+					return false;
236
+				}
228 237
 			}
229 238
 			return true;
230 239
 		}
@@ -295,7 +304,9 @@  discard block
 block discarded – undo
295 304
 
296 305
 		// A collection is simple if all it's components are simple
297 306
 		foreach ($this->components as $component) {
298
-			if (!$component->isSimple()) return false;
307
+			if (!$component->isSimple()) {
308
+				return false;
309
+			}
299 310
 		}
300 311
 
301 312
 		return true;
Please login to merge, or discard this patch.
htdocs/includes/geoPHP/lib/geometry/Point.class.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,9 @@
 block discarded – undo
83 83
 	{
84 84
 		if ($this->dimension == 3) {
85 85
 			return $this->coords[2];
86
-		} else return null;
86
+		} else {
87
+			return null;
88
+		}
87 89
 	}
88 90
 
89 91
 	/**
Please login to merge, or discard this patch.
htdocs/includes/geoPHP/lib/geometry/LineString.class.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,9 @@
 block discarded – undo
62 62
 
63 63
 	public function dimension()
64 64
 	{
65
-		if ($this->isEmpty()) return 0;
65
+		if ($this->isEmpty()) {
66
+			return 0;
67
+		}
66 68
 		return 1;
67 69
 	}
68 70
 
Please login to merge, or discard this patch.