Completed
Push — namespace2 ( 791eac...5c23fb )
by Fabio
08:41
created
framework/Vendor/ReCaptcha/recaptchalib.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -83,8 +83,10 @@  discard block
 block discarded – undo
83 83
 
84 84
         fwrite($fs, $http_request);
85 85
 
86
-        while ( !feof($fs) )
87
-                $response .= fgets($fs, 1160); // One TCP-IP packet
86
+        while ( !feof($fs) ) {
87
+                        $response .= fgets($fs, 1160);
88
+        }
89
+        // One TCP-IP packet
88 90
         fclose($fs);
89 91
         $response = explode("\r\n\r\n", $response, 2);
90 92
 
@@ -183,8 +185,7 @@  discard block
 block discarded – undo
183 185
 
184 186
         if (trim ($answers [0]) == 'true') {
185 187
                 $recaptcha_response->is_valid = true;
186
-        }
187
-        else {
188
+        } else {
188 189
                 $recaptcha_response->is_valid = false;
189 190
                 $recaptcha_response->error = $answers [1];
190 191
         }
Please login to merge, or discard this patch.
framework/Collections/TPriorityList.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -390,8 +390,7 @@  discard block
 block discarded – undo
390 390
 			}
391 391
 			$this->removeAtIndexInPriority($p[1],$p[0]);
392 392
 			return $p[2];
393
-		}
394
-		else
393
+		} else
395 394
 			throw new TInvalidDataValueException('list_item_inexistent');
396 395
 	}
397 396
 
@@ -676,14 +675,12 @@  discard block
 block discarded – undo
676 675
 				foreach($data->itemsAtPriority($priority) as $index=>$item)
677 676
 					$this->insertAtIndexInPriority($item,false,$priority);
678 677
 			}
679
-		}
680
-		else if(is_array($data)||$data instanceof \Traversable)
678
+		} else if(is_array($data)||$data instanceof \Traversable)
681 679
 		{
682 680
 			foreach($data as $priority=>$item)
683 681
 				$this->add($item);
684 682
 
685
-		}
686
-		else if($data!==null)
683
+		} else if($data!==null)
687 684
 			throw new TInvalidDataTypeException('map_data_not_iterable');
688 685
 	}
689 686
 
Please login to merge, or discard this patch.
framework/Collections/TPriorityMap.php 1 patch
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -364,13 +364,11 @@  discard block
 block discarded – undo
364 364
 			if(!isset($this->_d[$priority])) {
365 365
 				$this->_d[$priority]=array($key=>$value);
366 366
 				$this->_o=false;
367
-			}
368
-			else
367
+			} else
369 368
 				$this->_d[$priority][$key]=$value;
370 369
 			$this->_c++;
371 370
 			$this->_fd=null;
372
-		}
373
-		else
371
+		} else
374 372
 			throw new TInvalidOperationException('map_readonly',get_class($this));
375 373
 		return $priority;
376 374
 	}
@@ -412,8 +410,7 @@  discard block
 block discarded – undo
412 410
 						return $value;
413 411
 					}
414 412
 				return null;
415
-			}
416
-			else
413
+			} else
417 414
 			{
418 415
 				$priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p);
419 416
 				if(isset($this->_d[$priority])&&(isset($this->_d[$priority][$key])||array_key_exists($key,$this->_d[$priority])))
@@ -427,12 +424,10 @@  discard block
 block discarded – undo
427 424
 					}
428 425
 					$this->_fd=null;
429 426
 					return $value;
430
-				}
431
-				else
427
+				} else
432 428
 					return null;
433 429
 			}
434
-		}
435
-		else
430
+		} else
436 431
 			throw new TInvalidOperationException('map_readonly',get_class($this));
437 432
 	}
438 433
 
@@ -525,15 +520,13 @@  discard block
 block discarded – undo
525 520
 					$this->add($key,$value,$priority);
526 521
 				}
527 522
 			}
528
-		}
529
-		else if(is_array($data)||$data instanceof \Traversable)
523
+		} else if(is_array($data)||$data instanceof \Traversable)
530 524
 		{
531 525
 			if($this->getCount()>0)
532 526
 				$this->clear();
533 527
 			foreach($data as $key=>$value)
534 528
 				$this->add($key,$value);
535
-		}
536
-		else if($data!==null)
529
+		} else if($data!==null)
537 530
 			throw new TInvalidDataTypeException('map_data_not_iterable');
538 531
 	}
539 532
 
@@ -553,13 +546,11 @@  discard block
 block discarded – undo
553 546
 				foreach($data->itemsAtPriority($priority) as $key => $value)
554 547
 					$this->add($key,$value,$priority);
555 548
 			}
556
-		}
557
-		else if(is_array($data)||$data instanceof \Traversable)
549
+		} else if(is_array($data)||$data instanceof \Traversable)
558 550
 		{
559 551
 			foreach($data as $key=>$value)
560 552
 				$this->add($key,$value);
561
-		}
562
-		else if($data!==null)
553
+		} else if($data!==null)
563 554
 			throw new TInvalidDataTypeException('map_data_not_iterable');
564 555
 	}
565 556
 
Please login to merge, or discard this patch.
framework/TPropertyValue.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -123,11 +123,9 @@  discard block
 block discarded – undo
123 123
 			{
124 124
 				eval('$array=array'.$value.';');
125 125
 				return $array;
126
-			}
127
-			else
126
+			} else
128 127
 				return $len>0?array($value):array();
129
-		}
130
-		else
128
+		} else
131 129
 			return (array)$value;
132 130
 	}
133 131
 
@@ -170,8 +168,7 @@  discard block
 block discarded – undo
170 168
 				throw new TInvalidDataValueException(
171 169
 					'propertyvalue_enumvalue_invalid',$value,
172 170
 						implode(' | ',$types[$enums]->getConstants()));
173
-		}
174
-		else if(!is_array($enums))
171
+		} else if(!is_array($enums))
175 172
 		{
176 173
 			$enums=func_get_args();
177 174
 			array_shift($enums);
Please login to merge, or discard this patch.
framework/Util/TDbLogRoute.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -86,8 +86,7 @@  discard block
 block discarded – undo
86 86
 		try
87 87
 		{
88 88
 			$db->createCommand($sql)->query()->close();
89
-		}
90
-		catch(Exception $e)
89
+		} catch(Exception $e)
91 90
 		{
92 91
 			// DB table not exists
93 92
 			if($this->_autoCreate)
@@ -153,8 +152,7 @@  discard block
 block discarded – undo
153 152
 				return $config->getDbConnection();
154 153
 			else
155 154
 				throw new TConfigurationException('dblogroute_connectionid_invalid',$this->_connID);
156
-		}
157
-		else
155
+		} else
158 156
 		{
159 157
 			$db=new TDbConnection;
160 158
 			// default to SQLite3 database
Please login to merge, or discard this patch.
framework/Util/TLogRouter.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -72,15 +72,13 @@  discard block
 block discarded – undo
72 72
 				{
73 73
 					$phpConfig = include $this->_configFile;
74 74
 					$this->loadConfig($phpConfig);
75
-				}
76
-				else
75
+				} else
77 76
 				{
78 77
 					$dom=new TXmlDocument;
79 78
 					$dom->loadFromFile($this->_configFile);
80 79
 					$this->loadConfig($dom);
81 80
 				}
82
-			}
83
-			else
81
+			} else
84 82
 				throw new TConfigurationException('logrouter_configfile_invalid',$this->_configFile);
85 83
 		}
86 84
 		$this->loadConfig($config);
@@ -112,8 +110,7 @@  discard block
 block discarded – undo
112 110
 					$route->init($route);
113 111
 				}
114 112
 			}
115
-		}
116
-		else
113
+		} else
117 114
 		{
118 115
 			foreach($config->getElementsByTagName('route') as $routeConfig)
119 116
 			{
Please login to merge, or discard this patch.
framework/Util/TFirePhpLogRoute.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -158,8 +158,7 @@
 block discarded – undo
158 158
 				$e->setAttribute('maxOccurs','unbounded');
159 159
 				$sequence->appendChild($e);
160 160
 				$complexType->appendChild($sequence);
161
-			}
162
-			else
161
+			} else
163 162
 			{
164 163
 				$all = $dom->createElementNS('http://www.w3.org/2001/XMLSchema', 'xsd:all');
165 164
 				foreach($elements as $elem)
Please login to merge, or discard this patch.
framework/Caching/TDbCache.php 1 patch
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -204,8 +204,7 @@  discard block
 block discarded – undo
204 204
 				$this -> _createCheck = true;
205 205
 				$this -> getApplication() -> setGlobalState($key, time());
206 206
 			}
207
-		}
208
-		catch(\Exception $e)
207
+		} catch(\Exception $e)
209 208
 		{
210 209
 			// DB table not exists
211 210
 			if($this->_autoCreate)
@@ -228,8 +227,7 @@  discard block
 block discarded – undo
228 227
 
229 228
 				$this -> _createCheck = true;
230 229
 				$this -> getApplication() -> setGlobalState($key, time());
231
-			}
232
-			else
230
+			} else
233 231
 				throw new TConfigurationException('db_cachetable_inexistent',$this->_cacheTable);
234 232
 		}
235 233
 		$this->_cacheInitialized = true;
@@ -298,8 +296,7 @@  discard block
 block discarded – undo
298 296
 				return $config->getDbConnection();
299 297
 			else
300 298
 				throw new TConfigurationException('dbcache_connectionid_invalid',$this->_connID);
301
-		}
302
-		else
299
+		} else
303 300
 		{
304 301
 			$db=new TDbConnection;
305 302
 			if($this->_connectionString!=='')
@@ -309,8 +306,7 @@  discard block
 block discarded – undo
309 306
 					$db->setUsername($this->_username);
310 307
 				if($this->_password!=='')
311 308
 					$db->setPassword($this->_password);
312
-			}
313
-			else
309
+			} else
314 310
 			{
315 311
 				// default to SQLite3 database
316 312
 				$dbFile=$this->getApplication()->getRuntimePath().'/sqlite3.cache';
@@ -467,8 +463,7 @@  discard block
 block discarded – undo
467 463
 			$sql='SELECT value FROM '.$this->_cacheTable.' WHERE itemkey=\''.$key.'\' AND (expire=0 OR expire>'.time().') ORDER BY expire DESC';
468 464
 			$command=$this->getDbConnection()->createCommand($sql);
469 465
 			return unserialize($command->queryScalar());
470
-		}
471
-		catch(\Exception $e)
466
+		} catch(\Exception $e)
472 467
 		{
473 468
 			$this->initializeCache(true);
474 469
 			return unserialize($command->queryScalar());
@@ -511,16 +506,14 @@  discard block
 block discarded – undo
511 506
 			$command->bindValue(':value',serialize($value),\PDO::PARAM_LOB);
512 507
 			$command->execute();
513 508
 			return true;
514
-		}
515
-		catch(\Exception $e)
509
+		} catch(\Exception $e)
516 510
 		{
517 511
 			try
518 512
 			{
519 513
 				$this->initializeCache(true);
520 514
 				$command->execute();
521 515
 				return true;
522
-			}
523
-			catch(\Exception $e)
516
+			} catch(\Exception $e)
524 517
 			{
525 518
 				return false;
526 519
 			}
@@ -542,8 +535,7 @@  discard block
 block discarded – undo
542 535
 			$command->bindValue(':key',$key,\PDO::PARAM_STR);
543 536
 			$command->execute();
544 537
 			return true;
545
-		}
546
-		catch(\Exception $e)
538
+		} catch(\Exception $e)
547 539
 		{
548 540
 			$this->initializeCache(true);
549 541
 			$command->execute();
@@ -562,16 +554,14 @@  discard block
 block discarded – undo
562 554
 		{
563 555
 			$command = $this->getDbConnection()->createCommand("DELETE FROM {$this->_cacheTable}");
564 556
 			$command->execute();
565
-		}
566
-		catch(\Exception $e)
557
+		} catch(\Exception $e)
567 558
 		{
568 559
 			try
569 560
 			{
570 561
 				$this->initializeCache(true);
571 562
 				$command->execute();
572 563
 				return true;
573
-			}
574
-			catch(\Exception $e)
564
+			} catch(\Exception $e)
575 565
 			{
576 566
 				return false;
577 567
 			}
Please login to merge, or discard this patch.
framework/Caching/TDirectoryCacheDependency.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -532,8 +532,7 @@
 block discarded – undo
532 532
 			{
533 533
 				if(($this->_recursiveLevel<0 || $level<$this->_recursiveLevel) && $this->validateDirectory($path))
534 534
 					$timestamps=array_merge($this->generateTimestamps($path,$level+1));
535
-			}
536
-			else if($this->validateFile($path))
535
+			} else if($this->validateFile($path))
537 536
 				$timestamps[$path]=filemtime($path);
538 537
 		}
539 538
 		closedir($dir);
Please login to merge, or discard this patch.