Passed
Push — master ( 09abe8...7f2391 )
by Federico
02:56
created
examples/01essential/bundles/models/Template.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,13 +20,14 @@
 block discarded – undo
20 20
 		public function makeConnection() {
21 21
 			$jConfig = $this->parameters["app"];
22 22
 			$connection = null;
23
-			if( $jConfig != null && $jConfig->connection["enable"])
24
-				$connection = new Connection(
23
+			if( $jConfig != null && $jConfig->connection["enable"]) {
24
+							$connection = new Connection(
25 25
 						$jConfig->connection["server"]
26 26
 					, $jConfig->connection["database"]
27 27
 					, $jConfig->connection["user"]
28 28
 					, $jConfig->connection["password"]
29 29
 				);
30
+			}
30 31
 			$this->addConnection("base",$connection);
31 32
 		}
32 33
 		public function makeMenu() {
Please login to merge, or discard this patch.
examples/05database/bundles/models/Template.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,13 +20,14 @@
 block discarded – undo
20 20
 		public function makeConnection() {
21 21
 			$jConfig = $this->parameters["app"];
22 22
 			$connection = null;
23
-			if( $jConfig != null && $jConfig->connection["enable"])
24
-				$connection = new Connection(
23
+			if( $jConfig != null && $jConfig->connection["enable"]) {
24
+							$connection = new Connection(
25 25
 						$jConfig->connection["server"]
26 26
 					, $jConfig->connection["database"]
27 27
 					, $jConfig->connection["user"]
28 28
 					, $jConfig->connection["password"]
29 29
 				);
30
+			}
30 31
 			$this->addConnection("base",$connection);
31 32
 		}
32 33
 		public function makeMenu() {
Please login to merge, or discard this patch.
examples/03pageParameters/status.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,8 +22,9 @@  discard block
 block discarded – undo
22 22
 					$percent;
23 23
 					foreach (getGitLog() as $i) {
24 24
 						$cont++;
25
-						if($cont % $nPerCol == 1)
26
-							echo '<div class="row">';
25
+						if($cont % $nPerCol == 1) {
26
+													echo '<div class="row">';
27
+						}
27 28
 						if(isset($i["tag"])) {
28 29
 							$percent = explode(".",$i["tag"]);
29 30
 							$percent = 100 * intval($percent[0]) + 10 * intval($percent[1]) + intval($percent[2]);
@@ -32,7 +33,8 @@  discard block
 block discarded – undo
32 33
 						<div class="col-lg-<?=$dim?>">
33 34
 							<div class="well well-sm miniblock">
34 35
 								<div class="autor"><b>Autor:</b> <?=$i["author"]?><br></div>
35
-								<div class="tag"><b>Tag:</b> <?php if(isset($i["tag"])) echo $i["tag"]?><br></div>
36
+								<div class="tag"><b>Tag:</b> <?php if(isset($i["tag"])) {
37
+	echo $i["tag"]?><br></div>
36 38
 								<div class="date"><b>Date:</b> <?=$i["date"]?><br></div>
37 39
 								<div class="message"><b>Message:</b> <?=$i["message"]?><br></div>
38 40
 								<div class="progress">
@@ -46,6 +48,7 @@  discard block
 block discarded – undo
46 48
 					<?php
47 49
 					if($cont % $nPerCol == 0)
48 50
 						echo '</div>';
51
+}
49 52
 					} ?>
50 53
 				</div>
51 54
 			</div>
Please login to merge, or discard this patch.
examples/03pageParameters/bundles/models/Template.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,13 +20,14 @@
 block discarded – undo
20 20
 		public function makeConnection() {
21 21
 			$jConfig = $this->parameters["app"];
22 22
 			$connection = null;
23
-			if( $jConfig != null && $jConfig->connection["enable"])
24
-				$connection = new Connection(
23
+			if( $jConfig != null && $jConfig->connection["enable"]) {
24
+							$connection = new Connection(
25 25
 						$jConfig->connection["server"]
26 26
 					, $jConfig->connection["database"]
27 27
 					, $jConfig->connection["user"]
28 28
 					, $jConfig->connection["password"]
29 29
 				);
30
+			}
30 31
 			$this->addConnection("base",$connection);
31 32
 		}
32 33
 		public function makeMenu() {
Please login to merge, or discard this patch.
examples/03pageParameters/jate.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,14 +1,16 @@
 block discarded – undo
1 1
 <?php
2
-	if(!isset($GLOBALS["JATEPath"]))
3
-		$GLOBALS["JATEPath"] = [];
2
+	if(!isset($GLOBALS["JATEPath"])) {
3
+			$GLOBALS["JATEPath"] = [];
4
+	}
4 5
 	$commonLocations = array(
5 6
 		"bower_components/JATE/dist/",
6 7
 		"vendor/xaberr/jate/dist/",
7 8
 		"../../dist/"
8 9
 	);
9
-	foreach ($commonLocations as $i)
10
-		if(file_exists($i."jate/coreEngine.php")) {
10
+	foreach ($commonLocations as $i) {
11
+			if(file_exists($i."jate/coreEngine.php")) {
11 12
 			array_push($GLOBALS["JATEPath"], $i);
13
+	}
12 14
 			require_once($i."jate/coreEngine.php");
13 15
 			break;
14 16
 		}
Please login to merge, or discard this patch.
dist/jate/functions/requirer.php 1 patch
Braces   +20 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,29 +1,35 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 	function requireComponent( $_path, $_local = true ) {
3 3
 		$path = getJFolder($_path, $_local, debug_backtrace());
4
-		if(file_exists($path) && isPhp($path))
5
-			jRequire($path, false, 0);
6
-		else
7
-			requireError($_path);
4
+		if(file_exists($path) && isPhp($path)) {
5
+					jRequire($path, false, 0);
6
+		} else {
7
+					requireError($_path);
8
+		}
8 9
 	}
9 10
 	function requireComponents( $_path, $_local = true ) {
10 11
 		$path = getJFolder($_path, $_local, debug_backtrace());
11 12
 		if(file_exists($path)) {
12 13
 			$files = subFolderFile($path);
13 14
 			foreach ($files as $i) {
14
-				if(isPhp($path."/".$i))
15
-					requireComponent($path."/".$i, false, 0);
15
+				if(isPhp($path."/".$i)) {
16
+									requireComponent($path."/".$i, false, 0);
17
+				}
16 18
 			}
17
-		} else
18
-			requireError($_path);
19
+		} else {
20
+					requireError($_path);
21
+		}
19 22
 	}
20 23
 	function requireError( $_path ) {
21 24
 		global $DEBUG;
22
-		if( $DEBUG == 1 )
23
-			echo "Error load ($_path)<br>";
25
+		if( $DEBUG == 1 ) {
26
+					echo "Error load ($_path)<br>";
27
+		}
24 28
 	}
25 29
 	function isPhp ( $_file ) {
26
-		if(!is_file($_file)) return false;
30
+		if(!is_file($_file)) {
31
+			return false;
32
+		}
27 33
 		$info = pathinfo($_file);
28 34
 		return ($info["extension"] == "php") || ($info["extension"] == "PHP");
29 35
 	}
@@ -43,8 +49,9 @@  discard block
 block discarded – undo
43 49
 			$stackInfo = $_stack;
44 50
 			$folder = dirname($stackInfo[0]["file"]);
45 51
 			$file = "$folder/$_path";
46
-		} else
47
-			$file = $_path;
52
+		} else {
53
+					$file = $_path;
54
+		}
48 55
 		return $file;
49 56
 	}
50 57
 ?>
Please login to merge, or discard this patch.
dist/jate/modules/WebApp/WebApp.php 1 patch
Braces   +20 added lines, -14 removed lines patch added patch discarded remove patch
@@ -18,8 +18,9 @@  discard block
 block discarded – undo
18 18
 			if(is_array($_page)) {
19 19
 				$path		= $_page[0];
20 20
 				$class	= $_page[1];
21
-				if(isset($_page[2]))
22
-					$param = $_page[2];
21
+				if(isset($_page[2])) {
22
+									$param = $_page[2];
23
+				}
23 24
 			} else {
24 25
 				$path		= $_page;
25 26
 				$class	= $_page;
@@ -27,8 +28,9 @@  discard block
 block discarded – undo
27 28
 			$this->pages[$path] = [$class,$param];
28 29
 		}
29 30
 		public function addPages( $_pages ) {
30
-			foreach ($_pages as $i)
31
-				$this->addPage($i);
31
+			foreach ($_pages as $i) {
32
+							$this->addPage($i);
33
+			}
32 34
 		}
33 35
 		public function fetchPage( $_stack ) {
34 36
 			$parameters = [];
@@ -42,10 +44,11 @@  discard block
 block discarded – undo
42 44
 					break;
43 45
 				}
44 46
 			}
45
-			if( isset($temp[1]) && is_array($temp[1]) )
46
-				$temp[1] = array_merge($temp[1], $parameters);
47
-			else
48
-				$temp[1] = $parameters;
47
+			if( isset($temp[1]) && is_array($temp[1]) ) {
48
+							$temp[1] = array_merge($temp[1], $parameters);
49
+			} else {
50
+							$temp[1] = $parameters;
51
+			}
49 52
 			$this->currentPage = new $temp[0](["app" => $this->jConfig, "page" => $temp[1]]);
50 53
 			return $this->currentPage;
51 54
 		}
@@ -65,15 +68,18 @@  discard block
 block discarded – undo
65 68
 			$pathLength = count($_path);
66 69
 			if($urlLength == $pathLength) {
67 70
 				while($cont < $urlLength) {
68
-					if( $_path[$cont] == $_url[$cont] )
69
-						$cont++;
70
-					else if( strpos($_path[$cont], "\$") !== false ) {
71
+					if( $_path[$cont] == $_url[$cont] ) {
72
+											$cont++;
73
+					} else if( strpos($_path[$cont], "\$") !== false ) {
71 74
 						$variables[str_replace('$', "", $_path[$cont])] = $_url[$cont];
72 75
 						$cont++;
73
-					} else break;
76
+					} else {
77
+						break;
78
+					}
79
+				}
80
+				if($cont == $urlLength) {
81
+									return $variables;
74 82
 				}
75
-				if($cont == $urlLength)
76
-					return $variables;
77 83
 			}
78 84
 			return null;
79 85
 		}
Please login to merge, or discard this patch.