Test Failed
Push — master ( 463065...a58b06 )
by Federico
02:34
created
dist/jate/modules/Twig/Twig.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,16 +5,16 @@
 block discarded – undo
5 5
 		public function __construct() {
6 6
 			parent::__construct();
7 7
 		}
8
-		public function drawFile( $_file, $_parameters = [] ) {
9
-			$loader	= new Twig_Loader_Filesystem('bundles/views');
10
-			$twig		= new Twig_Environment( $loader, [
8
+		public function drawFile($_file, $_parameters = []) {
9
+			$loader = new Twig_Loader_Filesystem('bundles/views');
10
+			$twig = new Twig_Environment($loader, [
11 11
 				'cache' => 'bundles/views',
12 12
 			]);
13 13
 			$template = $twig->loadTemplate($_text);
14 14
 			$page = $template->render($_parameters);
15 15
 			return $page;
16 16
 		}
17
-		public function drawText( $_text, $_parameters = [] ) {
17
+		public function drawText($_text, $_parameters = []) {
18 18
 			$loader = new Twig_Loader_Array([
19 19
 				'index' => $_text
20 20
 			]);
Please login to merge, or discard this patch.
dist/jate/modules/Pug/Pug.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,13 +5,13 @@
 block discarded – undo
5 5
 		public function __construct() {
6 6
 			parent::__construct();
7 7
 		}
8
-		public function drawFile( $_file, $_parameters = [] ) {
8
+		public function drawFile($_file, $_parameters = []) {
9 9
 			return $this->draw($_file, $_parameters);
10 10
 		}
11
-		public function drawText( $_text, $_parameters = [] ) {
11
+		public function drawText($_text, $_parameters = []) {
12 12
 			return $this->draw(trim($_text), $_parameters);
13 13
 		}
14
-		public function draw( $_text, $_parameters = [] ) {
14
+		public function draw($_text, $_parameters = []) {
15 15
 			$pug = new Pug\Pug();
16 16
 			$page = $pug->render($_text, $_parameters);
17 17
 			return $page;
Please login to merge, or discard this patch.
dist/jate/functions/block.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -5,28 +5,28 @@  discard block
 block discarded – undo
5 5
 		return ob_start();
6 6
 	}
7 7
 
8
-	function jBlockClose( $_type = "html", $_parameters = [] ) {
8
+	function jBlockClose($_type = "html", $_parameters = []) {
9 9
 		return jBlockEnd($_type, $_parameters);
10 10
 	}
11 11
 
12
-	function jBlockFile( $_path, $_parameters = [] ) {
12
+	function jBlockFile($_path, $_parameters = []) {
13 13
 		$extension = explode(".", $_path);
14
-		$extension = $extension[count($extension)-1];
14
+		$extension = $extension[count($extension) - 1];
15 15
 		$extension = strtolower($extension);
16 16
 		return jBlockFileMan($_path, $extension, $_parameters);
17 17
 	}
18 18
 
19
-	function jBlockFileMan( $_path, $_type, $_parameters = [] ) {
19
+	function jBlockFileMan($_path, $_type, $_parameters = []) {
20 20
 		$temp = file_get_contents($_path);
21 21
 		return jBlockParsing($_type, $temp, $_parameters);
22 22
 	}
23 23
 
24
-	function jBlockEnd( $_type = "html", $_parameters = [] ) {
24
+	function jBlockEnd($_type = "html", $_parameters = []) {
25 25
 		$text = ob_get_clean();
26 26
 		return jBlockParsing($_type, $text, $_parameters);
27 27
 	}
28 28
 
29
-	function jBlockParsing( $_type = "html", $_string = "", $_parameters = [] ) {
29
+	function jBlockParsing($_type = "html", $_string = "", $_parameters = []) {
30 30
 		switch ($_type) {
31 31
 			case "pug":
32 32
 			case "jade":
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
 	}
50 50
 
51 51
 	function minifyOutput($_buffer) {
52
-		$search = array ( '/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s' );
53
-		$replace = array ( '>', '<', '\\1' );
54
-		if (preg_match("/\<html/i",$_buffer) == 1 && preg_match("/\<\/html\>/i",$_buffer) == 1)
52
+		$search = array('/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s');
53
+		$replace = array('>', '<', '\\1');
54
+		if (preg_match("/\<html/i", $_buffer) == 1 && preg_match("/\<\/html\>/i", $_buffer) == 1)
55 55
 			$_buffer = preg_replace($search, $replace, utf8_decode($_buffer));
56 56
 		return utf8_encode($_buffer);
57 57
 	}
Please login to merge, or discard this patch.
dist/jate/modules/Statistic/Statistic.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@
 block discarded – undo
1 1
 <?php
2 2
 	jRequire("../Module/Module.php");
3 3
 	class Statistic extends Module {
4
-		public function __construct( $_webApp ) {
4
+		public function __construct($_webApp) {
5 5
 			parent::__construct();
6 6
 			$pages = [];
7 7
 			$stats = [];
8 8
 			$pages = $_webApp->pages;
9
-			foreach ( $pages as $k => $v ) {
9
+			foreach ($pages as $k => $v) {
10 10
 				$temp = new $v[0]($v[1]);
11 11
 				$temp->addDipendences();
12 12
 				$stats[$k] = [];
13 13
 				$stats[$k]["page"]	= $v[0];
14 14
 				$stats[$k]["css"]		= $temp->data["css"];
15
-				$stats[$k]["js"]		= $temp->data["js"];
15
+				$stats[$k]["js"] = $temp->data["js"];
16 16
 			}
17 17
 			$this->data = $stats;
18 18
 		}
Please login to merge, or discard this patch.
dist/jate/modules/JConfig/JConfig.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -6,46 +6,46 @@
 block discarded – undo
6 6
 		public $pages;
7 7
 		public $server;
8 8
 		public function __construct() {
9
-			$this->connection["enable"]		= false;
10
-			$this->connection["user"]			= "";
9
+			$this->connection["enable"] = false;
10
+			$this->connection["user"] = "";
11 11
 			$this->connection["password"] = "";
12 12
 			$this->connection["database"] = "";
13
-			$this->connection["server"]		= "";
14
-			$this->all		= "";
13
+			$this->connection["server"] = "";
14
+			$this->all = "";
15 15
 			$this->DEBUG	= 0;
16 16
 			$this->pages	= [];
17
-			$this->server	= [];
17
+			$this->server = [];
18 18
 			$this->server["HTTP_HOST"]		= $_SERVER["HTTP_HOST"];
19
-			$this->server["REQUEST_URI"]	= $_SERVER["REQUEST_URI"];
19
+			$this->server["REQUEST_URI"] = $_SERVER["REQUEST_URI"];
20 20
 			$this->server["PHP_SELF"]			= $_SERVER["PHP_SELF"];
21 21
 			$this->server["RELATIVE"]			= str_replace("/index.php", "", $_SERVER["PHP_SELF"]);
22 22
 		}
23
-		public function import( $_path, $_type = "misc" ) {
23
+		public function import($_path, $_type = "misc") {
24 24
 			$data = file_get_contents($_path);
25 25
 			$data = json_decode($data);
26
-			if( $_type == "connection" )
26
+			if ($_type == "connection")
27 27
 				$this->overlayConnection($data);
28 28
 			else
29 29
 				$this->overlayMisc($data);
30 30
 		}
31
-		protected function overlayConnection( $_data ) {
31
+		protected function overlayConnection($_data) {
32 32
 			$this->connection = $this->obj2array($_data);
33 33
 		}
34
-		protected function overlayMisc( $_data ) {
34
+		protected function overlayMisc($_data) {
35 35
 			$this->importObject($_data);
36 36
 		}
37
-		protected function obj2array ( &$_instance ) {
38
-			$clone	= (array) $_instance;
37
+		protected function obj2array(&$_instance) {
38
+			$clone = (array) $_instance;
39 39
 			$return	= [];
40 40
 			$return['___SOURCE_KEYS_'] = $clone;
41
-			while ( list ($key, $value) = each ($clone) ) {
42
-				$temp		= explode ("\0", $key);
43
-				$newkey	= $temp[count($temp)-1];
41
+			while (list ($key, $value) = each($clone)) {
42
+				$temp		= explode("\0", $key);
43
+				$newkey = $temp[count($temp) - 1];
44 44
 				$return[$newkey] = &$return['___SOURCE_KEYS_'][$key];
45 45
 			}
46 46
 			return $return;
47 47
 		}
48
-		protected function importObject( $_object ) {
48
+		protected function importObject($_object) {
49 49
 			foreach (get_object_vars($_object) as $key => $value)
50 50
 				$this->$key = $value;
51 51
 		}
Please login to merge, or discard this patch.
dist/jate/modules/WebApp/WebApp.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -8,49 +8,49 @@  discard block
 block discarded – undo
8 8
 		public function __construct() {
9 9
 			parent::__construct();
10 10
 			$this->pages = [];
11
-			$this->defaultPage	= ["Page404",[]];
11
+			$this->defaultPage	= ["Page404", []];
12 12
 			$this->currentPage	= null;
13
-			$this->jConfig			= null;
13
+			$this->jConfig = null;
14 14
 		}
15
-		public function addPage( $_page ) {
15
+		public function addPage($_page) {
16 16
 			$param	= [];
17 17
 			$path		= $_page;
18 18
 			$class	= $_page;
19
-			if(is_array($_page)) {
19
+			if (is_array($_page)) {
20 20
 				$path		= $_page[0];
21 21
 				$class	= $_page[1];
22
-				if(isset($_page[2]))
22
+				if (isset($_page[2]))
23 23
 					$param = $_page[2];
24 24
 			}
25 25
 			$this->pages[$path] = [$class, $param];
26 26
 			return $this->pages[$path];
27 27
 		}
28
-		public function addPages( $_pages ) {
28
+		public function addPages($_pages) {
29 29
 			foreach ($_pages as $i)
30 30
 				$this->addPage($i);
31 31
 		}
32 32
 		public function fetchPage(  ) {
33 33
 			$router = new Router();
34
-			$router->parameters = [ "app" => &$this->jConfig, "page" => null];
34
+			$router->parameters = ["app" => &$this->jConfig, "page" => null];
35 35
 			$stack = $router->getPage();
36 36
 			$parameters = [];
37
-			$temp				= $this->defaultPage;
37
+			$temp = $this->defaultPage;
38 38
 			foreach ($this->pages as $key => $value) {
39 39
 				$variables = $this->pathSeeker(explode("/", $key), $stack);
40
-				if(is_array($variables)) {
40
+				if (is_array($variables)) {
41 41
 					$temp = $value;
42 42
 					$parameters = $variables;
43 43
 					break;
44 44
 				}
45 45
 			}
46
-			if( isset($temp[1]) && is_array($temp[1]) )
46
+			if (isset($temp[1]) && is_array($temp[1]))
47 47
 				$temp[1] = array_merge($temp[1], $parameters);
48 48
 			else
49 49
 				$temp[1] = $parameters;
50 50
 			$this->currentPage = new $temp[0](["app" => $this->jConfig, "page" => $temp[1]]);
51 51
 			return $this->currentPage;
52 52
 		}
53
-		public function setDefaultPage( $_page ) {
53
+		public function setDefaultPage($_page) {
54 54
 			$this->defaultPage = $this->addPage($_page);
55 55
 		}
56 56
 		public function draw() {
@@ -59,28 +59,28 @@  discard block
 block discarded – undo
59 59
 			$gui->init($this->currentPage);
60 60
 			$gui->draw($this->currentPage->data["template"]);
61 61
 		}
62
-		public function pathSeeker( $_path, $_url ) {
62
+		public function pathSeeker($_path, $_url) {
63 63
 			$urlLength = count($_url);
64 64
 			$cont = 0;
65 65
 			$variables = [];
66 66
 			$pathLength = count($_path);
67
-			if($urlLength == $pathLength) {
68
-				while($cont < $urlLength) {
69
-					if( $_path[$cont] == $_url[$cont] )
67
+			if ($urlLength == $pathLength) {
68
+				while ($cont < $urlLength) {
69
+					if ($_path[$cont] == $_url[$cont])
70 70
 						$cont++;
71
-					else if( strpos($_path[$cont], "\$") !== false ) {
71
+					else if (strpos($_path[$cont], "\$") !== false) {
72 72
 						$variables[str_replace('$', "", $_path[$cont])] = $_url[$cont];
73 73
 						$cont++;
74 74
 					} else break;
75 75
 				}
76
-				if($cont == $urlLength)
76
+				if ($cont == $urlLength)
77 77
 					return $variables;
78 78
 			}
79 79
 			return null;
80 80
 		}
81
-		public function newConfig( $_path = "config/") {
81
+		public function newConfig($_path = "config/") {
82 82
 			$this->jConfig = new JConfig();
83
-			$this->jConfig->import("${_path}connection.json","connection");
83
+			$this->jConfig->import("${_path}connection.json", "connection");
84 84
 			$this->jConfig->import("${_path}misc.json");
85 85
 			$this->jConfig->import("${_path}router.json");
86 86
 		}
Please login to merge, or discard this patch.
dist/status.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,17 +22,17 @@  discard block
 block discarded – undo
22 22
 					$percent;
23 23
 					foreach (getGitLog() as $i) {
24 24
 						$cont++;
25
-						if($cont % $nPerCol == 1)
25
+						if ($cont % $nPerCol == 1)
26 26
 							echo '<div class="row">';
27
-						if(isset($i["tag"])) {
28
-							$percent = explode(".",$i["tag"]);
27
+						if (isset($i["tag"])) {
28
+							$percent = explode(".", $i["tag"]);
29 29
 							$percent = 100 * intval($percent[0]) + 10 * intval($percent[1]) + intval($percent[2]);
30 30
 						}
31 31
 					?>
32 32
 						<div class="col-lg-<?=$dim?>">
33 33
 							<div class="well well-sm miniblock">
34 34
 								<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>
35
+								<div class="tag"><b>Tag:</b> <?php if (isset($i["tag"])) echo $i["tag"]?><br></div>
36 36
 								<div class="date"><b>Date:</b> <?=$i["date"]?><br></div>
37 37
 								<div class="message"><b>Message:</b> <?=$i["message"]?><br></div>
38 38
 								<div class="progress">
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 							</div>
45 45
 						</div>
46 46
 					<?php
47
-					if($cont % $nPerCol == 0)
47
+					if ($cont % $nPerCol == 0)
48 48
 						echo '</div>';
49 49
 					} ?>
50 50
 				</div>
Please login to merge, or discard this patch.
dist/jate/modules/Html/Html.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,32 +1,32 @@
 block discarded – undo
1 1
 <?php
2 2
 	requireComponent("../Query/Query.php");
3 3
 	class Html extends Query {
4
-		public function __construct( $_parameters = [ "app" => null, "page" => null] ) {
4
+		public function __construct($_parameters = ["app" => null, "page" => null]) {
5 5
 			parent::__construct();
6 6
 			$this->data["template"]					= "";
7 7
 			$this->tags["brand"]						= "";
8 8
 			$this->tags["brandImg"]					= "";
9 9
 			$this->tags["menu"]							= "";
10 10
 			$this->tags["title"]						= "";
11
-			$this->tags["subtitle"]		 			= "";
11
+			$this->tags["subtitle"] = "";
12 12
 			$this->tags["content"]				 	= "";
13
-			$this->tags["outContent"]		 		= "";
13
+			$this->tags["outContent"] = "";
14 14
 			$this->tags["footer"]		 				= "";
15 15
 			$this->tags["pagePath"]				 	= [];
16
-			$this->tags["css"]							= [];
17
-			$this->tags["js"]					 			= [];
16
+			$this->tags["css"] = [];
17
+			$this->tags["js"] = [];
18 18
 			$this->tags["jsVariables"]			= [];
19
-			$this->tags["metaDescription"]	= [];
20
-			$this->tags["metaKeywords"]			= [];
19
+			$this->tags["metaDescription"] = [];
20
+			$this->tags["metaKeywords"] = [];
21 21
 			$this->tags["metaAuthor"]				= [];
22
-			$this->parameters								= $_parameters;
23
-			$this->tags["base"]							= $_parameters["app"]->server["RELATIVE"]."/";
22
+			$this->parameters = $_parameters;
23
+			$this->tags["base"] = $_parameters["app"]->server["RELATIVE"]."/";
24 24
 		}
25 25
 		public function uniforma() {
26 26
 			$this->addDipendences();
27 27
 			$this->tags["css"]			= array_unique($this->tags["css"]);
28 28
 			$this->tags["js"]				= array_unique($this->tags["js"]);
29
-			$this->tags["pagePath"]	= json_encode($this->tags["pagePath"]);
29
+			$this->tags["pagePath"] = json_encode($this->tags["pagePath"]);
30 30
 			$tempStr = "";
31 31
 			$timeParameter = "?t=".time();
32 32
 			$time = ($this->parameters["app"]->cache->css == true) ? "" : $timeParameter;
Please login to merge, or discard this patch.
dist/jate.php 1 patch
Spacing   +3 added lines, -3 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 = [
5 5
 			"bower_components/JATE/dist/"
@@ -10,12 +10,12 @@  discard block
 block discarded – undo
10 10
 	];
11 11
 	$jSuccess = false;
12 12
 	foreach ($commonLocations as $path)
13
-		if(file_exists("${path}jate/coreEngine.php")) {
13
+		if (file_exists("${path}jate/coreEngine.php")) {
14 14
 			array_push($GLOBALS["JATEPath"], $path);
15 15
 			require_once("${path}jate/coreEngine.php");
16 16
 			$jSuccess = true;
17 17
 			break;
18 18
 		}
19
-	if( !$jSuccess )
19
+	if (!$jSuccess)
20 20
 		throw new Exception("JATE can't find coreEngine.php.");
21 21
 ?>
Please login to merge, or discard this patch.