Test Failed
Push — master ( 0ec979...014002 )
by Federico
01:54
created
dist/jate.php 3 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@
 block discarded – undo
1 1
 <?php
2 2
   if(!isset($GLOBALS["JATEPath"]))
3
-    $GLOBALS["JATEPath"] = [];
3
+	$GLOBALS["JATEPath"] = [];
4 4
   $commonLocations = [
5
-      "bower_components/JATE/dist/"
6
-    , "vendor/xaberr/jate/dist/"
7
-    , "../../dist/"
8
-    , "../dist/"
9
-    , dirname(__FILE__)."/"
5
+	  "bower_components/JATE/dist/"
6
+	, "vendor/xaberr/jate/dist/"
7
+	, "../../dist/"
8
+	, "../dist/"
9
+	, dirname(__FILE__)."/"
10 10
   ];
11 11
   $jSuccess = false;
12 12
   foreach ($commonLocations as $path)
13
-    if(file_exists("${path}jate/coreEngine.php")) {
14
-      array_push($GLOBALS["JATEPath"], $path);
15
-      require_once("${path}jate/coreEngine.php");
16
-      $jSuccess = true;
17
-      break;
18
-    }
13
+	if(file_exists("${path}jate/coreEngine.php")) {
14
+	  array_push($GLOBALS["JATEPath"], $path);
15
+	  require_once("${path}jate/coreEngine.php");
16
+	  $jSuccess = true;
17
+	  break;
18
+	}
19 19
   if( !$jSuccess )
20
-    throw new Exception("JATE can't find coreEngine.php.");
20
+	throw new Exception("JATE can't find coreEngine.php.");
21 21
 ?>
Please login to merge, or discard this 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.
Braces   +10 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 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 = [
5 6
       "bower_components/JATE/dist/"
6 7
     , "vendor/xaberr/jate/dist/"
@@ -9,13 +10,15 @@  discard block
 block discarded – undo
9 10
     , dirname(__FILE__)."/"
10 11
   ];
11 12
   $jSuccess = false;
12
-  foreach ($commonLocations as $path)
13
-    if(file_exists("${path}jate/coreEngine.php")) {
13
+  foreach ($commonLocations as $path) {
14
+      if(file_exists("${path}jate/coreEngine.php")) {
14 15
       array_push($GLOBALS["JATEPath"], $path);
16
+  }
15 17
       require_once("${path}jate/coreEngine.php");
16 18
       $jSuccess = true;
17 19
       break;
18 20
     }
19
-  if( !$jSuccess )
20
-    throw new Exception("JATE can't find coreEngine.php.");
21
-?>
21
+  if( !$jSuccess ) {
22
+      throw new Exception("JATE can't find coreEngine.php.");
23
+  }
24
+  ?>
Please login to merge, or discard this patch.
tests/jate/modules/Module/ModuleTest.php 2 patches
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -2,60 +2,60 @@
 block discarded – undo
2 2
   declare( strict_types = 1 );
3 3
   // backward compatibility
4 4
   if (!class_exists('\PHPUnit\Framework\TestCase')) {
5
-    class_alias('\PHPUnit_Framework_TestCase', '\PHPUnit\Framework\TestCase');
5
+	class_alias('\PHPUnit_Framework_TestCase', '\PHPUnit\Framework\TestCase');
6 6
   }
7 7
   use PHPUnit\Framework\TestCase;
8 8
 
9 9
   final class ModuleTest extends TestCase {
10
-    public function testAddFile() {
11
-      $this->expectException(InvalidArgumentException::class);
12
-      $module = new Module();
13
-      $module->addFile(123);
14
-    }
15
-    public function testAddFileRequired() {
16
-      $this->expectException(InvalidArgumentException::class);
17
-      $module = new Module();
18
-      $module->addFileRequired(123);
19
-    }
20
-    public function testAddFiles() {
21
-      $this->expectException(InvalidArgumentException::class);
22
-      $module = new Module();
23
-      $module->addFiles("/file.php");
24
-    }
25
-    public function testAddFilesRequired() {
26
-      $this->expectException(InvalidArgumentException::class);
27
-      $module = new Module();
28
-      $module->addFilesRequired("/file.php");
29
-    }
30
-    public function testAddModuleClass() {
31
-      $this->expectException(InvalidArgumentException::class);
32
-      $module = new Module();
33
-      $module->addModule(123);
34
-    }
35
-    public function testAddModuleNoModule() {
36
-      $this->expectException(InvalidArgumentException::class);
37
-      $module = new Module();
38
-      $module->addModule((object)[1,2,3]);
39
-    }
40
-    public function testAddModules() {
41
-      $this->expectException(InvalidArgumentException::class);
42
-      $module = new Module();
43
-      $module->addModules("Module");
44
-    }
45
-    public function testGetCss() {
46
-      $module = new Module();
47
-      $module->addFiles(["1.css","2.js","3.css","4.js"]);
48
-      $this->assertEquals(["1.css","3.css"], $module->getCss());
49
-    }
50
-    public function testGetJs() {
51
-      $module = new Module();
52
-      $module->addFiles(["1.css","2.js","3.css","4.js"]);
53
-      $this->assertEquals(["2.js","4.js"], $module->getJs());
54
-    }
55
-    public function testGetJsVariables() {
56
-      $module = new Module();
57
-      $module->addFiles(["1.css",["variable","2"],"3.css","4.js"]);
58
-      $this->assertEquals([["variable","2"]], $module->getJsVariables());
59
-    }
10
+	public function testAddFile() {
11
+	  $this->expectException(InvalidArgumentException::class);
12
+	  $module = new Module();
13
+	  $module->addFile(123);
14
+	}
15
+	public function testAddFileRequired() {
16
+	  $this->expectException(InvalidArgumentException::class);
17
+	  $module = new Module();
18
+	  $module->addFileRequired(123);
19
+	}
20
+	public function testAddFiles() {
21
+	  $this->expectException(InvalidArgumentException::class);
22
+	  $module = new Module();
23
+	  $module->addFiles("/file.php");
24
+	}
25
+	public function testAddFilesRequired() {
26
+	  $this->expectException(InvalidArgumentException::class);
27
+	  $module = new Module();
28
+	  $module->addFilesRequired("/file.php");
29
+	}
30
+	public function testAddModuleClass() {
31
+	  $this->expectException(InvalidArgumentException::class);
32
+	  $module = new Module();
33
+	  $module->addModule(123);
34
+	}
35
+	public function testAddModuleNoModule() {
36
+	  $this->expectException(InvalidArgumentException::class);
37
+	  $module = new Module();
38
+	  $module->addModule((object)[1,2,3]);
39
+	}
40
+	public function testAddModules() {
41
+	  $this->expectException(InvalidArgumentException::class);
42
+	  $module = new Module();
43
+	  $module->addModules("Module");
44
+	}
45
+	public function testGetCss() {
46
+	  $module = new Module();
47
+	  $module->addFiles(["1.css","2.js","3.css","4.js"]);
48
+	  $this->assertEquals(["1.css","3.css"], $module->getCss());
49
+	}
50
+	public function testGetJs() {
51
+	  $module = new Module();
52
+	  $module->addFiles(["1.css","2.js","3.css","4.js"]);
53
+	  $this->assertEquals(["2.js","4.js"], $module->getJs());
54
+	}
55
+	public function testGetJsVariables() {
56
+	  $module = new Module();
57
+	  $module->addFiles(["1.css",["variable","2"],"3.css","4.js"]);
58
+	  $this->assertEquals([["variable","2"]], $module->getJsVariables());
59
+	}
60 60
   }
61 61
 ?>
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-  declare( strict_types = 1 );
2
+  declare(strict_types = 1);
3 3
   // backward compatibility
4 4
   if (!class_exists('\PHPUnit\Framework\TestCase')) {
5 5
     class_alias('\PHPUnit_Framework_TestCase', '\PHPUnit\Framework\TestCase');
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     public function testAddModuleNoModule() {
36 36
       $this->expectException(InvalidArgumentException::class);
37 37
       $module = new Module();
38
-      $module->addModule((object)[1,2,3]);
38
+      $module->addModule((object) [1, 2, 3]);
39 39
     }
40 40
     public function testAddModules() {
41 41
       $this->expectException(InvalidArgumentException::class);
@@ -44,18 +44,18 @@  discard block
 block discarded – undo
44 44
     }
45 45
     public function testGetCss() {
46 46
       $module = new Module();
47
-      $module->addFiles(["1.css","2.js","3.css","4.js"]);
48
-      $this->assertEquals(["1.css","3.css"], $module->getCss());
47
+      $module->addFiles(["1.css", "2.js", "3.css", "4.js"]);
48
+      $this->assertEquals(["1.css", "3.css"], $module->getCss());
49 49
     }
50 50
     public function testGetJs() {
51 51
       $module = new Module();
52
-      $module->addFiles(["1.css","2.js","3.css","4.js"]);
53
-      $this->assertEquals(["2.js","4.js"], $module->getJs());
52
+      $module->addFiles(["1.css", "2.js", "3.css", "4.js"]);
53
+      $this->assertEquals(["2.js", "4.js"], $module->getJs());
54 54
     }
55 55
     public function testGetJsVariables() {
56 56
       $module = new Module();
57
-      $module->addFiles(["1.css",["variable","2"],"3.css","4.js"]);
58
-      $this->assertEquals([["variable","2"]], $module->getJsVariables());
57
+      $module->addFiles(["1.css", ["variable", "2"], "3.css", "4.js"]);
58
+      $this->assertEquals([["variable", "2"]], $module->getJsVariables());
59 59
     }
60 60
   }
61 61
 ?>
Please login to merge, or discard this patch.
dist/jate/modules/Connection/Adapters/ConnectionPostgresqlAdapter.php 3 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,16 +17,18 @@
 block discarded – undo
17 17
       public function queryFetch( $_query ) {
18 18
         $result = $this->stdQuery($_query);
19 19
         $rows = [];
20
-        while($row = pg_fetch_assoc($result))
21
-          $rows[] = $row;
20
+        while($row = pg_fetch_assoc($result)) {
21
+                  $rows[] = $row;
22
+        }
22 23
         pg_free_result($result);
23 24
         return $rows;
24 25
       }
25 26
       public function queryArray( $_query ) {
26 27
         $result = $this->stdQuery($_query);
27 28
         $rows = [];
28
-        while($row = pg_fetch_array($result))
29
-          $rows[] = $row;
29
+        while($row = pg_fetch_array($result)) {
30
+                  $rows[] = $row;
31
+        }
30 32
         pg_free_result($result);
31 33
         return $rows;
32 34
       }
Please login to merge, or discard this patch.
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -1,51 +1,51 @@
 block discarded – undo
1 1
 <?php
2 2
   jRequire("ConnectionInterface.php");
3 3
   class ConnectionPostgresqlAdapter implements ConnectionAdapterInterface {
4
-      public $connection;
5
-      public function __construct( $_srv, $_db, $_usr, $_pass ) {
6
-        try {
7
-          $this->connection = pg_connect("host=$_srv dbname=$_db user=$_usr password=$_pass")
8
-            or die('Could not connect: '.pg_last_error());
9
-        } catch( Exception $error ) {
10
-          Debug::log($error->getMessage());
11
-          exit();
12
-        }
13
-      }
14
-      public function query( $_query ) {
15
-        $this->stdQuery($_query);
16
-        return true;
17
-      }
18
-      public function queryInsert( $_query ) {
19
-        $this->stdQuery($_query);
20
-        return $this->stdQuery("SELECT lastval()");
21
-      }
22
-      public function queryFetch( $_query ) {
23
-        $result = $this->stdQuery($_query);
24
-        $rows = [];
25
-        while($row = pg_fetch_assoc($result))
26
-          $rows[] = $row;
27
-        pg_free_result($result);
28
-        return $rows;
29
-      }
30
-      public function queryArray( $_query ) {
31
-        $result = $this->stdQuery($_query);
32
-        $rows = [];
33
-        while($row = pg_fetch_array($result))
34
-          $rows[] = $row;
35
-        pg_free_result($result);
36
-        return $rows;
37
-      }
38
-      protected function stdQuery( $_query ) {
39
-        $database = $this->connection;
40
-        $result = pg_query($database, $_query);
41
-        if(!$result) {
42
-          Debug::logStack([
43
-            "query" => $_query,
44
-            "error" => pg_last_error()
45
-          ]);
46
-          exit();
47
-        }
48
-        return $result;
49
-      }
4
+	  public $connection;
5
+	  public function __construct( $_srv, $_db, $_usr, $_pass ) {
6
+		try {
7
+		  $this->connection = pg_connect("host=$_srv dbname=$_db user=$_usr password=$_pass")
8
+			or die('Could not connect: '.pg_last_error());
9
+		} catch( Exception $error ) {
10
+		  Debug::log($error->getMessage());
11
+		  exit();
12
+		}
13
+	  }
14
+	  public function query( $_query ) {
15
+		$this->stdQuery($_query);
16
+		return true;
17
+	  }
18
+	  public function queryInsert( $_query ) {
19
+		$this->stdQuery($_query);
20
+		return $this->stdQuery("SELECT lastval()");
21
+	  }
22
+	  public function queryFetch( $_query ) {
23
+		$result = $this->stdQuery($_query);
24
+		$rows = [];
25
+		while($row = pg_fetch_assoc($result))
26
+		  $rows[] = $row;
27
+		pg_free_result($result);
28
+		return $rows;
29
+	  }
30
+	  public function queryArray( $_query ) {
31
+		$result = $this->stdQuery($_query);
32
+		$rows = [];
33
+		while($row = pg_fetch_array($result))
34
+		  $rows[] = $row;
35
+		pg_free_result($result);
36
+		return $rows;
37
+	  }
38
+	  protected function stdQuery( $_query ) {
39
+		$database = $this->connection;
40
+		$result = pg_query($database, $_query);
41
+		if(!$result) {
42
+		  Debug::logStack([
43
+			"query" => $_query,
44
+			"error" => pg_last_error()
45
+		  ]);
46
+		  exit();
47
+		}
48
+		return $result;
49
+	  }
50 50
   }
51 51
 ?>
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -2,43 +2,43 @@
 block discarded – undo
2 2
   jRequire("ConnectionInterface.php");
3 3
   class ConnectionPostgresqlAdapter implements ConnectionAdapterInterface {
4 4
       public $connection;
5
-      public function __construct( $_srv, $_db, $_usr, $_pass ) {
5
+      public function __construct($_srv, $_db, $_usr, $_pass) {
6 6
         try {
7 7
           $this->connection = pg_connect("host=$_srv dbname=$_db user=$_usr password=$_pass")
8 8
             or die('Could not connect: '.pg_last_error());
9
-        } catch( Exception $error ) {
9
+        } catch (Exception $error) {
10 10
           Debug::log($error->getMessage());
11 11
           exit();
12 12
         }
13 13
       }
14
-      public function query( $_query ) {
14
+      public function query($_query) {
15 15
         $this->stdQuery($_query);
16 16
         return true;
17 17
       }
18
-      public function queryInsert( $_query ) {
18
+      public function queryInsert($_query) {
19 19
         $this->stdQuery($_query);
20 20
         return $this->stdQuery("SELECT lastval()");
21 21
       }
22
-      public function queryFetch( $_query ) {
22
+      public function queryFetch($_query) {
23 23
         $result = $this->stdQuery($_query);
24 24
         $rows = [];
25
-        while($row = pg_fetch_assoc($result))
25
+        while ($row = pg_fetch_assoc($result))
26 26
           $rows[] = $row;
27 27
         pg_free_result($result);
28 28
         return $rows;
29 29
       }
30
-      public function queryArray( $_query ) {
30
+      public function queryArray($_query) {
31 31
         $result = $this->stdQuery($_query);
32 32
         $rows = [];
33
-        while($row = pg_fetch_array($result))
33
+        while ($row = pg_fetch_array($result))
34 34
           $rows[] = $row;
35 35
         pg_free_result($result);
36 36
         return $rows;
37 37
       }
38
-      protected function stdQuery( $_query ) {
38
+      protected function stdQuery($_query) {
39 39
         $database = $this->connection;
40 40
         $result = pg_query($database, $_query);
41
-        if(!$result) {
41
+        if (!$result) {
42 42
           Debug::logStack([
43 43
             "query" => $_query,
44 44
             "error" => pg_last_error()
Please login to merge, or discard this patch.
dist/jate/coreEngine.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -4,14 +4,14 @@
 block discarded – undo
4 4
 
5 5
   //JATE SUFF
6 6
   require_once      (end($GLOBALS["JATEPath"])."jate/functions/requirer.php");
7
-  requireComponent  ("functions/folder.php");
8
-  requireComponent  ("modules/JConfig/JConfig.php");
9
-  requireComponents ("functions");
10
-  requireModules    ("modules");
7
+  requireComponent("functions/folder.php");
8
+  requireComponent("modules/JConfig/JConfig.php");
9
+  requireComponents("functions");
10
+  requireModules("modules");
11 11
 
12 12
   //USER STUFF
13
-  requireComponent  ("config.php",false);
14
-  requireModules    ("modules",false);
15
-  requireComponents ("bundles/models",false);
16
-  requireComponents ("bundles/controllers",false);
13
+  requireComponent("config.php", false);
14
+  requireModules("modules", false);
15
+  requireComponents("bundles/models", false);
16
+  requireComponents("bundles/controllers", false);
17 17
 ?>
Please login to merge, or discard this patch.
dist/jate/modules/JConfig/JConfig.php 3 patches
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -1,55 +1,55 @@
 block discarded – undo
1 1
 <?php
2 2
   class JConfig {
3
-    public $connection;
4
-    public $all;
5
-    public $DEBUG;
6
-    public $pages;
7
-    public $server;
8
-    public function __construct() {
9
-      $this->connection["enable"]    = false;
10
-      $this->connection["user"]      = "";
11
-      $this->connection["password"] = "";
12
-      $this->connection["database"] = "";
13
-      $this->connection["server"]    = "";
14
-      $this->all    = "";
15
-      $this->DEBUG  = 0;
16
-      $this->pages  = [];
17
-      $this->server  = [];
18
-      $this->server["HTTP_HOST"]    = $_SERVER["HTTP_HOST"];
19
-      $this->server["REQUEST_URI"]  = $_SERVER["REQUEST_URI"];
20
-      $this->server["PHP_SELF"]      = $_SERVER["PHP_SELF"];
21
-      $this->server["RELATIVE"]      = str_replace("/index.php", "", $_SERVER["PHP_SELF"]);
22
-    }
23
-    public function import( $_path, $_type = "misc" ) {
24
-      $data = file_get_contents($_path);
25
-      $data = json_decode($data);
26
-      if($data === NULL)
27
-        Debug::log("Error processing [$_path]");
28
-      if( $_type == "connection" )
29
-        $this->overlayConnection($data);
30
-      else
31
-        $this->overlayMisc($data);
32
-    }
33
-    protected function overlayConnection( $_data ) {
34
-      $this->connection = $this->obj2array($_data);
35
-    }
36
-    protected function overlayMisc( $_data ) {
37
-      $this->importObject($_data);
38
-    }
39
-    protected function obj2array ( &$_instance ) {
40
-      $clone  = (array) $_instance;
41
-      $return  = [];
42
-      $return['___SOURCE_KEYS_'] = $clone;
43
-      while ( list ($key, $value) = each ($clone) ) {
44
-        $temp    = explode ("\0", $key);
45
-        $newkey  = $temp[count($temp)-1];
46
-        $return[$newkey] = &$return['___SOURCE_KEYS_'][$key];
47
-      }
48
-      return $return;
49
-    }
50
-    protected function importObject( $_object ) {
51
-      foreach (get_object_vars($_object) as $key => $value)
52
-        $this->$key = $value;
53
-    }
3
+	public $connection;
4
+	public $all;
5
+	public $DEBUG;
6
+	public $pages;
7
+	public $server;
8
+	public function __construct() {
9
+	  $this->connection["enable"]    = false;
10
+	  $this->connection["user"]      = "";
11
+	  $this->connection["password"] = "";
12
+	  $this->connection["database"] = "";
13
+	  $this->connection["server"]    = "";
14
+	  $this->all    = "";
15
+	  $this->DEBUG  = 0;
16
+	  $this->pages  = [];
17
+	  $this->server  = [];
18
+	  $this->server["HTTP_HOST"]    = $_SERVER["HTTP_HOST"];
19
+	  $this->server["REQUEST_URI"]  = $_SERVER["REQUEST_URI"];
20
+	  $this->server["PHP_SELF"]      = $_SERVER["PHP_SELF"];
21
+	  $this->server["RELATIVE"]      = str_replace("/index.php", "", $_SERVER["PHP_SELF"]);
22
+	}
23
+	public function import( $_path, $_type = "misc" ) {
24
+	  $data = file_get_contents($_path);
25
+	  $data = json_decode($data);
26
+	  if($data === NULL)
27
+		Debug::log("Error processing [$_path]");
28
+	  if( $_type == "connection" )
29
+		$this->overlayConnection($data);
30
+	  else
31
+		$this->overlayMisc($data);
32
+	}
33
+	protected function overlayConnection( $_data ) {
34
+	  $this->connection = $this->obj2array($_data);
35
+	}
36
+	protected function overlayMisc( $_data ) {
37
+	  $this->importObject($_data);
38
+	}
39
+	protected function obj2array ( &$_instance ) {
40
+	  $clone  = (array) $_instance;
41
+	  $return  = [];
42
+	  $return['___SOURCE_KEYS_'] = $clone;
43
+	  while ( list ($key, $value) = each ($clone) ) {
44
+		$temp    = explode ("\0", $key);
45
+		$newkey  = $temp[count($temp)-1];
46
+		$return[$newkey] = &$return['___SOURCE_KEYS_'][$key];
47
+	  }
48
+	  return $return;
49
+	}
50
+	protected function importObject( $_object ) {
51
+	  foreach (get_object_vars($_object) as $key => $value)
52
+		$this->$key = $value;
53
+	}
54 54
   }
55 55
 ?>
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -14,40 +14,40 @@
 block discarded – undo
14 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 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($data === NULL)
26
+      if ($data === NULL)
27 27
         Debug::log("Error processing [$_path]");
28
-      if( $_type == "connection" )
28
+      if ($_type == "connection")
29 29
         $this->overlayConnection($data);
30 30
       else
31 31
         $this->overlayMisc($data);
32 32
     }
33
-    protected function overlayConnection( $_data ) {
33
+    protected function overlayConnection($_data) {
34 34
       $this->connection = $this->obj2array($_data);
35 35
     }
36
-    protected function overlayMisc( $_data ) {
36
+    protected function overlayMisc($_data) {
37 37
       $this->importObject($_data);
38 38
     }
39
-    protected function obj2array ( &$_instance ) {
40
-      $clone  = (array) $_instance;
41
-      $return  = [];
39
+    protected function obj2array(&$_instance) {
40
+      $clone = (array) $_instance;
41
+      $return = [];
42 42
       $return['___SOURCE_KEYS_'] = $clone;
43
-      while ( list ($key, $value) = each ($clone) ) {
44
-        $temp    = explode ("\0", $key);
45
-        $newkey  = $temp[count($temp)-1];
43
+      while (list ($key, $value) = each($clone)) {
44
+        $temp    = explode("\0", $key);
45
+        $newkey  = $temp[count($temp) - 1];
46 46
         $return[$newkey] = &$return['___SOURCE_KEYS_'][$key];
47 47
       }
48 48
       return $return;
49 49
     }
50
-    protected function importObject( $_object ) {
50
+    protected function importObject($_object) {
51 51
       foreach (get_object_vars($_object) as $key => $value)
52 52
         $this->$key = $value;
53 53
     }
Please login to merge, or discard this patch.
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -23,12 +23,14 @@  discard block
 block discarded – undo
23 23
     public function import( $_path, $_type = "misc" ) {
24 24
       $data = file_get_contents($_path);
25 25
       $data = json_decode($data);
26
-      if($data === NULL)
27
-        Debug::log("Error processing [$_path]");
28
-      if( $_type == "connection" )
29
-        $this->overlayConnection($data);
30
-      else
31
-        $this->overlayMisc($data);
26
+      if($data === NULL) {
27
+              Debug::log("Error processing [$_path]");
28
+      }
29
+      if( $_type == "connection" ) {
30
+              $this->overlayConnection($data);
31
+      } else {
32
+              $this->overlayMisc($data);
33
+      }
32 34
     }
33 35
     protected function overlayConnection( $_data ) {
34 36
       $this->connection = $this->obj2array($_data);
@@ -48,8 +50,9 @@  discard block
 block discarded – undo
48 50
       return $return;
49 51
     }
50 52
     protected function importObject( $_object ) {
51
-      foreach (get_object_vars($_object) as $key => $value)
52
-        $this->$key = $value;
53
+      foreach (get_object_vars($_object) as $key => $value) {
54
+              $this->$key = $value;
55
+      }
53 56
     }
54 57
   }
55 58
 ?>
Please login to merge, or discard this patch.
dist/jate/modules/Query/Query.php 3 patches
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -1,48 +1,48 @@
 block discarded – undo
1 1
 <?php
2 2
   jRequire("../Module/Module.php");
3 3
   class Query extends Module {
4
-    public $connection;
5
-    public $currentConnection;
6
-    public function __construct() {
7
-      parent::__construct();
8
-      $this->connection = [];
9
-      $this->currentConnection = null;
10
-    }
11
-    public function addConnection( $_name, $_connection ) {
12
-      Debug::push();
13
-      $this->connection["$_name"] = $_connection;
14
-      $this->currentConnection = $_connection;
15
-      foreach ($this->modules as &$module)
16
-        if(isset($module->currentConnection))
17
-          $module->addConnection($_name, $_connection);
18
-      Debug::pop();
19
-    }
20
-    public function setConnection( $_name ) {
21
-      $this->currentConnection = $this->connection["$_name"];
22
-    }
23
-    public function query( $_query ) {
24
-      Debug::push();
25
-      $temp = $this->currentConnection->database->query($_query);
26
-      Debug::pop();
27
-      return $temp;
28
-    }
29
-    public function queryInsert( $_query ) {
30
-      Debug::push();
31
-      $temp = $this->currentConnection->database->queryInsert($_query);
32
-      Debug::pop();
33
-      return $temp;
34
-    }
35
-    public function queryFetch( $_query ) {
36
-      Debug::push();
37
-      $temp = $this->currentConnection->database->queryFetch($_query);
38
-      Debug::pop();
39
-      return $temp;
40
-    }
41
-    public function queryArray( $_query ) {
42
-      Debug::push();
43
-      $temp = $this->currentConnection->database->queryArray($_query);
44
-      Debug::pop();
45
-      return $temp;
46
-    }
4
+	public $connection;
5
+	public $currentConnection;
6
+	public function __construct() {
7
+	  parent::__construct();
8
+	  $this->connection = [];
9
+	  $this->currentConnection = null;
10
+	}
11
+	public function addConnection( $_name, $_connection ) {
12
+	  Debug::push();
13
+	  $this->connection["$_name"] = $_connection;
14
+	  $this->currentConnection = $_connection;
15
+	  foreach ($this->modules as &$module)
16
+		if(isset($module->currentConnection))
17
+		  $module->addConnection($_name, $_connection);
18
+	  Debug::pop();
19
+	}
20
+	public function setConnection( $_name ) {
21
+	  $this->currentConnection = $this->connection["$_name"];
22
+	}
23
+	public function query( $_query ) {
24
+	  Debug::push();
25
+	  $temp = $this->currentConnection->database->query($_query);
26
+	  Debug::pop();
27
+	  return $temp;
28
+	}
29
+	public function queryInsert( $_query ) {
30
+	  Debug::push();
31
+	  $temp = $this->currentConnection->database->queryInsert($_query);
32
+	  Debug::pop();
33
+	  return $temp;
34
+	}
35
+	public function queryFetch( $_query ) {
36
+	  Debug::push();
37
+	  $temp = $this->currentConnection->database->queryFetch($_query);
38
+	  Debug::pop();
39
+	  return $temp;
40
+	}
41
+	public function queryArray( $_query ) {
42
+	  Debug::push();
43
+	  $temp = $this->currentConnection->database->queryArray($_query);
44
+	  Debug::pop();
45
+	  return $temp;
46
+	}
47 47
   }
48 48
 ?>
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,37 +8,37 @@
 block discarded – undo
8 8
       $this->connection = [];
9 9
       $this->currentConnection = null;
10 10
     }
11
-    public function addConnection( $_name, $_connection ) {
11
+    public function addConnection($_name, $_connection) {
12 12
       Debug::push();
13 13
       $this->connection["$_name"] = $_connection;
14 14
       $this->currentConnection = $_connection;
15 15
       foreach ($this->modules as &$module)
16
-        if(isset($module->currentConnection))
16
+        if (isset($module->currentConnection))
17 17
           $module->addConnection($_name, $_connection);
18 18
       Debug::pop();
19 19
     }
20
-    public function setConnection( $_name ) {
20
+    public function setConnection($_name) {
21 21
       $this->currentConnection = $this->connection["$_name"];
22 22
     }
23
-    public function query( $_query ) {
23
+    public function query($_query) {
24 24
       Debug::push();
25 25
       $temp = $this->currentConnection->database->query($_query);
26 26
       Debug::pop();
27 27
       return $temp;
28 28
     }
29
-    public function queryInsert( $_query ) {
29
+    public function queryInsert($_query) {
30 30
       Debug::push();
31 31
       $temp = $this->currentConnection->database->queryInsert($_query);
32 32
       Debug::pop();
33 33
       return $temp;
34 34
     }
35
-    public function queryFetch( $_query ) {
35
+    public function queryFetch($_query) {
36 36
       Debug::push();
37 37
       $temp = $this->currentConnection->database->queryFetch($_query);
38 38
       Debug::pop();
39 39
       return $temp;
40 40
     }
41
-    public function queryArray( $_query ) {
41
+    public function queryArray($_query) {
42 42
       Debug::push();
43 43
       $temp = $this->currentConnection->database->queryArray($_query);
44 44
       Debug::pop();
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,9 +12,10 @@
 block discarded – undo
12 12
       Debug::push();
13 13
       $this->connection["$_name"] = $_connection;
14 14
       $this->currentConnection = $_connection;
15
-      foreach ($this->modules as &$module)
16
-        if(isset($module->currentConnection))
15
+      foreach ($this->modules as &$module) {
16
+              if(isset($module->currentConnection))
17 17
           $module->addConnection($_name, $_connection);
18
+      }
18 19
       Debug::pop();
19 20
     }
20 21
     public function setConnection( $_name ) {
Please login to merge, or discard this patch.
dist/jate/modules/Connection/Adapters/ConnectionPdoAdapter.php 2 patches
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -1,47 +1,47 @@
 block discarded – undo
1 1
 <?php
2 2
   jRequire("ConnectionInterface.php");
3 3
   class ConnectionPdoAdapter implements ConnectionAdapterInterface {
4
-      public $connection;
5
-      public function __construct( $_srv, $_db, $_usr, $_pass ) {
6
-        try {
7
-          $connection = "mysql:host=$_srv;dbname=$_db";
8
-          $this->connection = new PDO( $connection, $_usr, $_pass, [PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"] );
9
-        } catch( Exception $error ) {
10
-          Debug::log($error->getMessage());
11
-          exit();
12
-        }
13
-      }
14
-      public function query( $_query ) {
15
-        $this->stdQuery($_query);
16
-        return true;
17
-      }
18
-      public function queryInsert( $_query ) {
19
-        $this->stdQuery($_query);
20
-        return $this->connection->lastInsertId();
21
-      }
22
-      public function queryFetch( $_query ) {
23
-        $temp = $this->stdQuery($_query);
24
-        return $temp->fetchAll(PDO::FETCH_ASSOC);
25
-      }
26
-      public function queryArray( $_query ) {
27
-        $temp = $this->stdQuery($_query);
28
-        return $temp->fetchAll(PDO::FETCH_COLUMN, 0);
29
-      }
30
-      protected function stdQuery( $_query ) {
31
-        $database = $this->connection;
32
-        $query = $database->prepare($_query);
33
-        $result = $query->execute();
34
-        if(!$result) {
35
-          Debug::logStack([
36
-            "query" => $_query,
37
-            "error" => [
38
-              $query->errorInfo(),
39
-              $database->errorInfo()
40
-            ]
41
-          ]);
42
-          exit();
43
-        }
44
-        return $query;
45
-      }
4
+	  public $connection;
5
+	  public function __construct( $_srv, $_db, $_usr, $_pass ) {
6
+		try {
7
+		  $connection = "mysql:host=$_srv;dbname=$_db";
8
+		  $this->connection = new PDO( $connection, $_usr, $_pass, [PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"] );
9
+		} catch( Exception $error ) {
10
+		  Debug::log($error->getMessage());
11
+		  exit();
12
+		}
13
+	  }
14
+	  public function query( $_query ) {
15
+		$this->stdQuery($_query);
16
+		return true;
17
+	  }
18
+	  public function queryInsert( $_query ) {
19
+		$this->stdQuery($_query);
20
+		return $this->connection->lastInsertId();
21
+	  }
22
+	  public function queryFetch( $_query ) {
23
+		$temp = $this->stdQuery($_query);
24
+		return $temp->fetchAll(PDO::FETCH_ASSOC);
25
+	  }
26
+	  public function queryArray( $_query ) {
27
+		$temp = $this->stdQuery($_query);
28
+		return $temp->fetchAll(PDO::FETCH_COLUMN, 0);
29
+	  }
30
+	  protected function stdQuery( $_query ) {
31
+		$database = $this->connection;
32
+		$query = $database->prepare($_query);
33
+		$result = $query->execute();
34
+		if(!$result) {
35
+		  Debug::logStack([
36
+			"query" => $_query,
37
+			"error" => [
38
+			  $query->errorInfo(),
39
+			  $database->errorInfo()
40
+			]
41
+		  ]);
42
+		  exit();
43
+		}
44
+		return $query;
45
+	  }
46 46
   }
47 47
 ?>
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -2,36 +2,36 @@
 block discarded – undo
2 2
   jRequire("ConnectionInterface.php");
3 3
   class ConnectionPdoAdapter implements ConnectionAdapterInterface {
4 4
       public $connection;
5
-      public function __construct( $_srv, $_db, $_usr, $_pass ) {
5
+      public function __construct($_srv, $_db, $_usr, $_pass) {
6 6
         try {
7 7
           $connection = "mysql:host=$_srv;dbname=$_db";
8
-          $this->connection = new PDO( $connection, $_usr, $_pass, [PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"] );
9
-        } catch( Exception $error ) {
8
+          $this->connection = new PDO($connection, $_usr, $_pass, [PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"]);
9
+        } catch (Exception $error) {
10 10
           Debug::log($error->getMessage());
11 11
           exit();
12 12
         }
13 13
       }
14
-      public function query( $_query ) {
14
+      public function query($_query) {
15 15
         $this->stdQuery($_query);
16 16
         return true;
17 17
       }
18
-      public function queryInsert( $_query ) {
18
+      public function queryInsert($_query) {
19 19
         $this->stdQuery($_query);
20 20
         return $this->connection->lastInsertId();
21 21
       }
22
-      public function queryFetch( $_query ) {
22
+      public function queryFetch($_query) {
23 23
         $temp = $this->stdQuery($_query);
24 24
         return $temp->fetchAll(PDO::FETCH_ASSOC);
25 25
       }
26
-      public function queryArray( $_query ) {
26
+      public function queryArray($_query) {
27 27
         $temp = $this->stdQuery($_query);
28 28
         return $temp->fetchAll(PDO::FETCH_COLUMN, 0);
29 29
       }
30
-      protected function stdQuery( $_query ) {
30
+      protected function stdQuery($_query) {
31 31
         $database = $this->connection;
32 32
         $query = $database->prepare($_query);
33 33
         $result = $query->execute();
34
-        if(!$result) {
34
+        if (!$result) {
35 35
           Debug::logStack([
36 36
             "query" => $_query,
37 37
             "error" => [
Please login to merge, or discard this patch.
dist/jate/modules/Debug/Debug.php 3 patches
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -1,54 +1,54 @@
 block discarded – undo
1 1
 <?php
2 2
   // requireComponent("../functions/array.php");
3 3
   class Debug {
4
-    public static $stack;
5
-    private static $initialized = false;
6
-    private function __construct() {}
7
-    private static function initialize() {
8
-      if (self::$initialized)
9
-        return;
10
-      self::$stack = [];
11
-      self::$initialized = true;
12
-    }
13
-    private static function out( $_object ) {
14
-      if(is_object($_object)) {
15
-        echo "isObject";
16
-      } else if(is_array($_object)) {
17
-        arrayDump($_object, "Debug");
18
-      } else {
19
-        echo $_object;
20
-      }
21
-    }
22
-    public static function log( $_object ) {
23
-      self::out(["error" => $_object]);
24
-    }
25
-    public static function logln( $_object ) {
26
-      self::log($_object);
27
-      self::out("<br>");
28
-    }
29
-    public static function logStack( $_object ) {
30
-      self::out([
31
-        "position" => self::$stack,
32
-        "error" => $_object
33
-      ]);
34
-      self::out("<br>");
35
-    }
36
-    public static function push() {
37
-      $debugInfo = debug_backtrace();
38
-      $debugInfo = [
39
-        "file" => $debugInfo[1]["file"],
40
-        "line" => $debugInfo[1]["line"],
41
-        "function" => $debugInfo[1]["function"],
42
-        "class" => $debugInfo[1]["class"]
43
-      ];
44
-      self::$stack[] = $debugInfo;
45
-    }
46
-    public static function pop() {
47
-      if(count(self::$stack)>0)
48
-        array_shift(self::$stack);
49
-    }
50
-    public static function emptyStack() {
51
-      self::$stack = [];
52
-    }
4
+	public static $stack;
5
+	private static $initialized = false;
6
+	private function __construct() {}
7
+	private static function initialize() {
8
+	  if (self::$initialized)
9
+		return;
10
+	  self::$stack = [];
11
+	  self::$initialized = true;
12
+	}
13
+	private static function out( $_object ) {
14
+	  if(is_object($_object)) {
15
+		echo "isObject";
16
+	  } else if(is_array($_object)) {
17
+		arrayDump($_object, "Debug");
18
+	  } else {
19
+		echo $_object;
20
+	  }
21
+	}
22
+	public static function log( $_object ) {
23
+	  self::out(["error" => $_object]);
24
+	}
25
+	public static function logln( $_object ) {
26
+	  self::log($_object);
27
+	  self::out("<br>");
28
+	}
29
+	public static function logStack( $_object ) {
30
+	  self::out([
31
+		"position" => self::$stack,
32
+		"error" => $_object
33
+	  ]);
34
+	  self::out("<br>");
35
+	}
36
+	public static function push() {
37
+	  $debugInfo = debug_backtrace();
38
+	  $debugInfo = [
39
+		"file" => $debugInfo[1]["file"],
40
+		"line" => $debugInfo[1]["line"],
41
+		"function" => $debugInfo[1]["function"],
42
+		"class" => $debugInfo[1]["class"]
43
+	  ];
44
+	  self::$stack[] = $debugInfo;
45
+	}
46
+	public static function pop() {
47
+	  if(count(self::$stack)>0)
48
+		array_shift(self::$stack);
49
+	}
50
+	public static function emptyStack() {
51
+	  self::$stack = [];
52
+	}
53 53
   }
54 54
 ?>
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,23 +10,23 @@  discard block
 block discarded – undo
10 10
       self::$stack = [];
11 11
       self::$initialized = true;
12 12
     }
13
-    private static function out( $_object ) {
14
-      if(is_object($_object)) {
13
+    private static function out($_object) {
14
+      if (is_object($_object)) {
15 15
         echo "isObject";
16
-      } else if(is_array($_object)) {
16
+      } else if (is_array($_object)) {
17 17
         arrayDump($_object, "Debug");
18 18
       } else {
19 19
         echo $_object;
20 20
       }
21 21
     }
22
-    public static function log( $_object ) {
22
+    public static function log($_object) {
23 23
       self::out(["error" => $_object]);
24 24
     }
25
-    public static function logln( $_object ) {
25
+    public static function logln($_object) {
26 26
       self::log($_object);
27 27
       self::out("<br>");
28 28
     }
29
-    public static function logStack( $_object ) {
29
+    public static function logStack($_object) {
30 30
       self::out([
31 31
         "position" => self::$stack,
32 32
         "error" => $_object
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
       self::$stack[] = $debugInfo;
45 45
     }
46 46
     public static function pop() {
47
-      if(count(self::$stack)>0)
47
+      if (count(self::$stack) > 0)
48 48
         array_shift(self::$stack);
49 49
     }
50 50
     public static function emptyStack() {
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,8 +5,9 @@  discard block
 block discarded – undo
5 5
     private static $initialized = false;
6 6
     private function __construct() {}
7 7
     private static function initialize() {
8
-      if (self::$initialized)
9
-        return;
8
+      if (self::$initialized) {
9
+              return;
10
+      }
10 11
       self::$stack = [];
11 12
       self::$initialized = true;
12 13
     }
@@ -44,8 +45,9 @@  discard block
 block discarded – undo
44 45
       self::$stack[] = $debugInfo;
45 46
     }
46 47
     public static function pop() {
47
-      if(count(self::$stack)>0)
48
-        array_shift(self::$stack);
48
+      if(count(self::$stack)>0) {
49
+              array_shift(self::$stack);
50
+      }
49 51
     }
50 52
     public static function emptyStack() {
51 53
       self::$stack = [];
Please login to merge, or discard this patch.