Completed
Push — master ( a12ace...998a95 )
by Federico
02:48
created
dist/jate/functions/array.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -11,6 +11,10 @@
 block discarded – undo
11 11
 	function arrayHtmlParser($_array) {
12 12
 		return travelStringArray($_array,"htmlParser");
13 13
 	}
14
+
15
+	/**
16
+	 * @param string $_function
17
+	 */
14 18
 	function travelStringArray ( $_array, $_function ) {
15 19
 		if (is_array($_array)) {
16 20
 			foreach ($_array as $k => $v) {
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,27 +1,27 @@
 block discarded – undo
1 1
 <?php
2 2
 	function utf8ize($_array) {
3
-		return travelStringArray($_array,"utf8_encode");
3
+		return travelStringArray($_array, "utf8_encode");
4 4
 	}
5 5
 	function unutf8ize($_array) {
6
-		return travelStringArray($_array,"utf8_decode");
6
+		return travelStringArray($_array, "utf8_decode");
7 7
 	}
8 8
 	function arraySlash($_array) {
9
-		return travelStringArray($_array,"addslashes");
9
+		return travelStringArray($_array, "addslashes");
10 10
 	}
11 11
 	function arrayHtmlParser($_array) {
12
-		return travelStringArray($_array,"htmlParser");
12
+		return travelStringArray($_array, "htmlParser");
13 13
 	}
14
-	function travelStringArray ( $_array, $_function ) {
14
+	function travelStringArray($_array, $_function) {
15 15
 		if (is_array($_array)) {
16 16
 			foreach ($_array as $k => $v) {
17 17
 				$_array[$k] = travelStringArray($v, $_function);
18 18
 			}
19
-		} else if (is_string ($_array)) {
20
-			return call_user_func($_function,$_array);
19
+		} else if (is_string($_array)) {
20
+			return call_user_func($_function, $_array);
21 21
 		}
22 22
 		return $_array;
23 23
 	}
24
-	function arrayDepth( $_array ) {
24
+	function arrayDepth($_array) {
25 25
 		$maxDepth = 1;
26 26
 		foreach ($_array as $value) {
27 27
 			if (is_array($value)) {
Please login to merge, or discard this patch.
dist/jate/functions/folder.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -17,6 +17,10 @@
 block discarded – undo
17 17
 		});
18 18
 		return $temp;
19 19
 	}
20
+
21
+	/**
22
+	 * @param Closure $_function
23
+	 */
20 24
 	function fetchInSubFolder( $_dir = "./", $_function) {
21 25
 		$temp = [];
22 26
 		if (is_dir($_dir)) {
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,41 +1,41 @@
 block discarded – undo
1 1
 <?php
2
-	function subFolder( $_dir = "./" ) {
3
-		$temp = fetchInSubFolder($_dir, function( $_file ) {
2
+	function subFolder($_dir = "./") {
3
+		$temp = fetchInSubFolder($_dir, function($_file) {
4 4
 			return true;
5 5
 		});
6 6
 		return $temp;
7 7
 	}
8
-	function subFolderFile( $_dir = "./" ) {
9
-		$temp = fetchInSubFolder($_dir, function( $_file ) {
8
+	function subFolderFile($_dir = "./") {
9
+		$temp = fetchInSubFolder($_dir, function($_file) {
10 10
 			return !is_dir($_file);
11 11
 		});
12 12
 		return $temp;
13 13
 	}
14
-	function subFolderDir( $_dir = "./" ) {
15
-		$temp = fetchInSubFolder($_dir, function( $_file ) {
14
+	function subFolderDir($_dir = "./") {
15
+		$temp = fetchInSubFolder($_dir, function($_file) {
16 16
 			return !is_file($_file);
17 17
 		});
18 18
 		return $temp;
19 19
 	}
20
-	function fetchInSubFolder( $_dir = "./", $_function) {
20
+	function fetchInSubFolder($_dir = "./", $_function) {
21 21
 		$temp = [];
22 22
 		if (is_dir($_dir)) {
23 23
 				if ($dirOpened = opendir($_dir)) {
24 24
 						while (($file = readdir($dirOpened)) !== false)
25
-								if( ($file !='.')&&($file !='..') )
26
-									if($_function($file))
27
-										array_push($temp,$file);
25
+								if (($file != '.') && ($file != '..'))
26
+									if ($_function($file))
27
+										array_push($temp, $file);
28 28
 						closedir($dirOpened);
29 29
 				}
30 30
 		}
31 31
 		return $temp;
32 32
 	}
33
-	function requireSubfolder( $_dir = "./" ) {
33
+	function requireSubfolder($_dir = "./") {
34 34
 		$temp = subFolderFile($_dir);
35 35
 		foreach ($temp as $i)
36 36
 			jRequire($_dir."/".$i);
37 37
 	}
38
-	function require_js( $_dir = "./" ) {
38
+	function require_js($_dir = "./") {
39 39
 		$tempArray = [];
40 40
 		$temp = subFolderFile($_dir);
41 41
 		foreach ($temp as $i)
Please login to merge, or discard this patch.
dist/jate/functions/requirer.php 2 patches
Doc Comments   +17 added lines patch added patch discarded remove patch
@@ -1,4 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
+	/**
3
+	 * @param string $_path
4
+	 * @param integer $_stack
5
+	 */
2 6
 	function requireComponent( $_path, $_local = true, $_stack = null ) {
3 7
 		$path = getJFolder($_path, $_local, debug_backtrace());
4 8
 		if(file_exists($path) && isPhp($path))
@@ -6,6 +10,11 @@  discard block
 block discarded – undo
6 10
 		else
7 11
 			requireError($_path);
8 12
 	}
13
+
14
+	/**
15
+	 * @param string $_path
16
+	 * @param integer $_stack
17
+	 */
9 18
 	function requireComponents( $_path, $_local = true, $_stack = null ) {
10 19
 		$path = getJFolder($_path, $_local, debug_backtrace());
11 20
 		if(file_exists($path)) {
@@ -34,10 +43,18 @@  discard block
 block discarded – undo
34 43
 			requireComponents($path."/".$i, false, 0);
35 44
 		}
36 45
 	}
46
+
47
+	/**
48
+	 * @param integer $_stack
49
+	 */
37 50
 	function jRequire( $_path, $_local = true, $_stack = null ) {
38 51
 		$path = getJFolder($_path, $_local, debug_backtrace());
39 52
 		require_once( $path );
40 53
 	}
54
+
55
+	/**
56
+	 * @param boolean $_local
57
+	 */
41 58
 	function getJFolder( $_path, $_local, $_stack ) {
42 59
 		if($_local) {
43 60
 			$stackInfo = $_stack;
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,45 +1,45 @@
 block discarded – undo
1 1
 <?php
2
-	function requireComponent( $_path, $_local = true, $_stack = null ) {
2
+	function requireComponent($_path, $_local = true, $_stack = null) {
3 3
 		$path = getJFolder($_path, $_local, debug_backtrace());
4
-		if(file_exists($path) && isPhp($path))
4
+		if (file_exists($path) && isPhp($path))
5 5
 			jRequire($path, false, 0);
6 6
 		else
7 7
 			requireError($_path);
8 8
 	}
9
-	function requireComponents( $_path, $_local = true, $_stack = null ) {
9
+	function requireComponents($_path, $_local = true, $_stack = null) {
10 10
 		$path = getJFolder($_path, $_local, debug_backtrace());
11
-		if(file_exists($path)) {
11
+		if (file_exists($path)) {
12 12
 			$files = subFolder_file($path);
13 13
 			foreach ($files as $i) {
14
-				if(isPhp($path."/".$i))
14
+				if (isPhp($path."/".$i))
15 15
 					requireComponent($path."/".$i, false, 0);
16 16
 			}
17 17
 		} else
18 18
 			requireError($_path);
19 19
 	}
20
-	function requireError( $_path ) {
20
+	function requireError($_path) {
21 21
 		global $jConfig;
22
-		if( $jConfig->DEBUG == 1 )
22
+		if ($jConfig->DEBUG == 1)
23 23
 			echo "Error load ($_path)<br>";
24 24
 	}
25
-	function isPhp ( $_file ) {
26
-		if(!is_file($_file)) return false;
25
+	function isPhp($_file) {
26
+		if (!is_file($_file)) return false;
27 27
 		$info = pathinfo($_file);
28 28
 		return ($info["extension"] == "php") || ($info["extension"] == "PHP");
29 29
 	}
30
-	function requireModules( $_path, $_local = true, $_stack = null ) {
30
+	function requireModules($_path, $_local = true, $_stack = null) {
31 31
 		$path = getJFolder($_path, $_local, debug_backtrace());
32 32
 		$subFolders = subFolder_dir($path);
33 33
 		foreach ($subFolders as $i) {
34 34
 			requireComponents($path."/".$i, false, 0);
35 35
 		}
36 36
 	}
37
-	function jRequire( $_path, $_local = true, $_stack = null ) {
37
+	function jRequire($_path, $_local = true, $_stack = null) {
38 38
 		$path = getJFolder($_path, $_local, debug_backtrace());
39
-		require_once( $path );
39
+		require_once($path);
40 40
 	}
41
-	function getJFolder( $_path, $_local, $_stack ) {
42
-		if($_local) {
41
+	function getJFolder($_path, $_local, $_stack) {
42
+		if ($_local) {
43 43
 			$stackInfo = $_stack;
44 44
 			$folder = dirname($stackInfo[0]["file"]);
45 45
 			$file = "$folder/$_path";
Please login to merge, or discard this patch.
dist/jate/modules/GUI/GUI.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -11,6 +11,10 @@
 block discarded – undo
11 11
 			$render = $this->overlayTag($page);
12 12
 			echo minify_output($render);
13 13
 		}
14
+
15
+		/**
16
+		 * @param string $_page
17
+		 */
14 18
 		protected function overlayTag( $_page ) {
15 19
 			foreach($this->data as $key => $value) {
16 20
 				$_page = str_replace("<_".$key."_>", "$value", $_page);
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,16 +3,16 @@
 block discarded – undo
3 3
 		public function __construct() {
4 4
 			parent::__construct();
5 5
 		}
6
-		public function init( $_page ) {
6
+		public function init($_page) {
7 7
 			$this->data = $_page->data;
8 8
 		}
9
-		public function draw( $_template ) {
9
+		public function draw($_template) {
10 10
 			$page = file_get_contents($_template);
11 11
 			$render = $this->overlayTag($page);
12 12
 			echo minify_output($render);
13 13
 		}
14
-		protected function overlayTag( $_page ) {
15
-			foreach($this->data as $key => $value) {
14
+		protected function overlayTag($_page) {
15
+			foreach ($this->data as $key => $value) {
16 16
 				$_page = str_replace("<_".$key."_>", "$value", $_page);
17 17
 			}
18 18
 			return $_page;
Please login to merge, or discard this patch.
dist/jate/modules/Module/Module.php 2 patches
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -35,6 +35,10 @@  discard block
 block discarded – undo
35 35
 		public function addModule( $_mod ) {
36 36
 			$this->modules[$_mod->name] = $_mod;
37 37
 		}
38
+
39
+		/**
40
+		 * @param string[] $_files
41
+		 */
38 42
 		public function addFiles( $_files ) {
39 43
 			foreach ($_files as $value)
40 44
 				$this->addFile($value);
@@ -47,6 +51,11 @@  discard block
 block discarded – undo
47 51
 			$this->data["js"] = $this->getJs();
48 52
 			$this->data["jsVariables"] = $this->getJsVariables();
49 53
 		}
54
+
55
+		/**
56
+		 * @param string $_function
57
+		 * @param string $_extenction
58
+		 */
50 59
 		protected function getRequire( $_function, $_extenction) {
51 60
 			$temp = [];
52 61
 			foreach ($this->modules as $i)
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -7,51 +7,51 @@  discard block
 block discarded – undo
7 7
 		public $data;
8 8
 		public function __construct() {
9 9
 			$this->name			= get_class($this);
10
-			$this->modules	= [];
10
+			$this->modules = [];
11 11
 			$this->files		= [];
12
-			$this->required	= [];
12
+			$this->required = [];
13 13
 			$this->data			= [];
14 14
 		}
15 15
 		// abstract public function config();
16 16
 		// abstract public function init();
17 17
 		// abstract public function draw();
18 18
 		public function getCss() {
19
-			return $this->getRequire("getCss",".css");
19
+			return $this->getRequire("getCss", ".css");
20 20
 		}
21 21
 		public function getJs() {
22
-			return $this->getRequire("getJs",".js");
22
+			return $this->getRequire("getJs", ".js");
23 23
 		}
24 24
 		public function getJsVariables() {
25 25
 			$temp = [];
26 26
 			foreach ($this->required as $i)
27 27
 				if (is_array($i))
28
-					array_push($temp,$i);
28
+					array_push($temp, $i);
29 29
 			foreach ($this->modules as $i)
30
-				$temp = array_merge( $temp, $i->getJsVariables() );
30
+				$temp = array_merge($temp, $i->getJsVariables());
31 31
 			foreach ($this->files as $i)
32 32
 				if (is_array($i))
33
-					array_push($temp,$i);
33
+					array_push($temp, $i);
34 34
 			return $temp;
35 35
 		}
36
-		public function addModules( $_mods ) {
36
+		public function addModules($_mods) {
37 37
 			foreach ($_mods as $value)
38 38
 				$this->addModule($value);
39 39
 		}
40
-		public function addModule( $_mod ) {
40
+		public function addModule($_mod) {
41 41
 			$this->modules[$_mod->name] = $_mod;
42 42
 		}
43
-		public function addFiles( $_files ) {
43
+		public function addFiles($_files) {
44 44
 			foreach ($_files as $value)
45 45
 				$this->addFile($value);
46 46
 		}
47
-		public function addFile( $_file ) {
47
+		public function addFile($_file) {
48 48
 			array_push($this->files, $_file);
49 49
 		}
50
-		public function addFilesRequired( $_files ) {
50
+		public function addFilesRequired($_files) {
51 51
 			foreach ($_files as $value)
52 52
 				$this->addFileRequired($value);
53 53
 		}
54
-		public function addFileRequired( $_file ) {
54
+		public function addFileRequired($_file) {
55 55
 			array_push($this->required, $_file);
56 56
 		}
57 57
 		protected function addDipendences() {
@@ -59,16 +59,16 @@  discard block
 block discarded – undo
59 59
 			$this->data["js"] = $this->getJs();
60 60
 			$this->data["jsVariables"] = $this->getJsVariables();
61 61
 		}
62
-		protected function getRequire( $_function, $_extenction) {
62
+		protected function getRequire($_function, $_extenction) {
63 63
 			$temp = [];
64 64
 			foreach ($this->required as $i)
65 65
 				if (!is_array($i) && strpos($i, $_extenction) !== FALSE)
66
-					array_push($temp,$i);
66
+					array_push($temp, $i);
67 67
 			foreach ($this->modules as $i)
68
-				$temp = array_merge( $temp, $i->$_function() );
68
+				$temp = array_merge($temp, $i->$_function());
69 69
 			foreach ($this->files as $i)
70 70
 				if (!is_array($i) && strpos($i, $_extenction) !== FALSE)
71
-					array_push($temp,$i);
71
+					array_push($temp, $i);
72 72
 			return $temp;
73 73
 		}
74 74
 	}
Please login to merge, or discard this patch.
examples/05database/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 	require_once("main.php");
3
-	if(!isset($_GET["page"])) $_GET["page"] = "home";
3
+	if (!isset($_GET["page"])) $_GET["page"] = "home";
4 4
 	$webApp->fetchPage($_GET["page"]);
5 5
 	$webApp->draw();
6 6
 ?>
Please login to merge, or discard this patch.
examples/05database/jate.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-	if(!isset($GLOBALS["JATEPath"]))
2
+	if (!isset($GLOBALS["JATEPath"]))
3 3
 		$GLOBALS["JATEPath"] = [];
4 4
 	$commonLocations = array(
5 5
 		"bower_components/JATE/dist/",
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 		"../../dist/"
8 8
 	);
9 9
 	foreach ($commonLocations as $i)
10
-		if(file_exists($i."jate/coreEngine.php")) {
10
+		if (file_exists($i."jate/coreEngine.php")) {
11 11
 			array_push($GLOBALS["JATEPath"], $i);
12 12
 			require_once($i."jate/coreEngine.php");
13 13
 			break;
Please login to merge, or discard this patch.
dist/jate/coreEngine.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -5,20 +5,20 @@
 block discarded – undo
5 5
 	//JATE SUFF
6 6
 	require_once			(end($GLOBALS["JATEPath"])."jate/functions/requirer.php");
7 7
 	//USER STUFF
8
-	requireComponent	("modules/JConfig/JConfig.php");
9
-	$jConfig	= new JConfig();
8
+	requireComponent("modules/JConfig/JConfig.php");
9
+	$jConfig = new JConfig();
10 10
 	$jConfig->import("config.json");
11 11
 	//JATE STUFF
12
-	requireComponent	("functions/folder.php");
12
+	requireComponent("functions/folder.php");
13 13
 
14 14
 	//JATE SUFF
15
-	requireComponent	("modules/Module/Module.php");
16
-	requireComponents	("functions");
17
-	requireModules		("modules");
15
+	requireComponent("modules/Module/Module.php");
16
+	requireComponents("functions");
17
+	requireModules("modules");
18 18
 
19 19
 	//USER STUFF
20
-	requireComponent	("config.php",false);
21
-	requireModules		("modules",false);
22
-	requireComponent	("pages/Template.php",false);
23
-	requireComponents	("pages",false);
20
+	requireComponent("config.php", false);
21
+	requireModules("modules", false);
22
+	requireComponent("pages/Template.php", false);
23
+	requireComponents("pages", false);
24 24
 ?>
Please login to merge, or discard this patch.
dist/jate/functions/git.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2
-	function getGitLog( $_dir = "./" ) {
3
-		if(!file_exists($_dir)) return [];
2
+	function getGitLog($_dir = "./") {
3
+		if (!file_exists($_dir)) return [];
4 4
 		$currentDir = getcwd();
5 5
 		chdir($_dir);
6 6
 		$git_history = [];
7 7
 		$git_logs	= [];
8
-		$gitPath	= str_replace('\\', '/', exec("git rev-parse --show-toplevel"));
9
-		$rootPath	= str_replace('\\', '/', getcwd ());
10
-		if( $gitPath != $rootPath ) {
8
+		$gitPath = str_replace('\\', '/', exec("git rev-parse --show-toplevel"));
9
+		$rootPath	= str_replace('\\', '/', getcwd());
10
+		if ($gitPath != $rootPath) {
11 11
 			chdir($currentDir);
12 12
 			return [];
13 13
 		}
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 					$git_history[$last_hash]['date'] = date('d/m/Y H:i:s A', strtotime($date));
48 48
 				}
49 49
 				else
50
-					$git_history[$last_hash]['message'] .= $line ." ";
50
+					$git_history[$last_hash]['message'] .= $line." ";
51 51
 			}
52 52
 		}
53 53
 		chdir($currentDir);
Please login to merge, or discard this patch.