Test Failed
Push — master ( ad2809...463065 )
by Federico
04:15 queued 18s
created
dist/jate/modules/Connection/Adapters/ConnectionInterface.php 2 patches
Doc Comments   +8 added lines patch added patch discarded remove patch
@@ -1,6 +1,14 @@
 block discarded – undo
1 1
 <?php
2 2
 	interface ConnectionAdapterInterface {
3
+
4
+		/**
5
+		 * @return void
6
+		 */
3 7
 		public function __construct( $_srv, $_db, $_usr, $_pass);
8
+
9
+		/**
10
+		 * @return boolean
11
+		 */
4 12
 		public function query( $_query );
5 13
 		public function queryFetch( $_query );
6 14
 		public function queryArray( $_query );
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 	interface ConnectionAdapterInterface {
3
-		public function __construct( $_srv, $_db, $_usr, $_pass);
4
-		public function query( $_query );
5
-		public function queryFetch( $_query );
6
-		public function queryArray( $_query );
7
-		public function queryInsert( $_query );
3
+		public function __construct($_srv, $_db, $_usr, $_pass);
4
+		public function query($_query);
5
+		public function queryFetch($_query);
6
+		public function queryArray($_query);
7
+		public function queryInsert($_query);
8 8
 	}
9 9
 ?>
Please login to merge, or discard this patch.
dist/jate/modules/Connection/Connection.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -8,20 +8,20 @@  discard block
 block discarded – undo
8 8
 			parent::__construct();
9 9
 			$args = func_get_args();
10 10
 			$count = func_num_args();
11
-			if (method_exists($this,$func='__construct'.$count))
12
-				call_user_func_array(array($this,$func),$args);
11
+			if (method_exists($this, $func = '__construct'.$count))
12
+				call_user_func_array(array($this, $func), $args);
13 13
 		}
14 14
 		public function __construct0() {
15 15
 			$this->database = null;
16 16
 		}
17
-		public function __construct4 ( $_srv, $_db, $_usr, $_pass ) {
17
+		public function __construct4($_srv, $_db, $_usr, $_pass) {
18 18
 			$this->setConnection($_srv, $_db, $_usr, $_pass, "pdo");
19 19
 		}
20
-		public function __construct5 ( $_srv, $_db, $_usr, $_pass, $_type ) {
20
+		public function __construct5($_srv, $_db, $_usr, $_pass, $_type) {
21 21
 			$type = $this->getConnectionType($_type);
22 22
 			$this->setConnection($_srv, $_db, $_usr, $_pass, $type);
23 23
 		}
24
-		protected function setConnection ( $_srv, $_db, $_usr, $_pass, $_type ) {
24
+		protected function setConnection($_srv, $_db, $_usr, $_pass, $_type) {
25 25
 			switch ($_type) {
26 26
 				case "mysqli":
27 27
 					$this->database = new ConnectionMysqliAdapter($_srv, $_db, $_usr, $_pass);
@@ -30,19 +30,19 @@  discard block
 block discarded – undo
30 30
 					$this->database = new ConnectionPdoAdapter($_srv, $_db, $_usr, $_pass);
31 31
 				break;
32 32
 			}
33
-			$this->setConnectionParameters( $_srv, $_db, $_usr, $_pass);
33
+			$this->setConnectionParameters($_srv, $_db, $_usr, $_pass);
34 34
 		}
35
-		protected function getConnectionType( $_type ) {
35
+		protected function getConnectionType($_type) {
36 36
 			foreach ($_type as $key => $value)
37
-				if($value)
37
+				if ($value)
38 38
 					return $key;
39 39
 			return "pdo";
40 40
 		}
41
-		protected function setConnectionParameters( $_srv, $_db, $_usr, $_pass) {
41
+		protected function setConnectionParameters($_srv, $_db, $_usr, $_pass) {
42 42
 			$this->info = [];
43
-			$this->info["server"]		= $_srv;
43
+			$this->info["server"] = $_srv;
44 44
 			$this->info["database"]	= $_db;
45
-			$this->info["user"]			= $_usr;
45
+			$this->info["user"] = $_usr;
46 46
 			$this->info["password"]	= $_pass;
47 47
 		}
48 48
 	}
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,8 +8,9 @@  discard block
 block discarded – undo
8 8
 			parent::__construct();
9 9
 			$args = func_get_args();
10 10
 			$count = func_num_args();
11
-			if (method_exists($this,$func='__construct'.$count))
12
-				call_user_func_array(array($this,$func),$args);
11
+			if (method_exists($this,$func='__construct'.$count)) {
12
+							call_user_func_array(array($this,$func),$args);
13
+			}
13 14
 		}
14 15
 		public function __construct0() {
15 16
 			$this->database = null;
@@ -33,9 +34,10 @@  discard block
 block discarded – undo
33 34
 			$this->setConnectionParameters( $_srv, $_db, $_usr, $_pass);
34 35
 		}
35 36
 		protected function getConnectionType( $_type ) {
36
-			foreach ($_type as $key => $value)
37
-				if($value)
37
+			foreach ($_type as $key => $value) {
38
+							if($value)
38 39
 					return $key;
40
+			}
39 41
 			return "pdo";
40 42
 		}
41 43
 		protected function setConnectionParameters( $_srv, $_db, $_usr, $_pass) {
Please login to merge, or discard this patch.
dist/jate/modules/Connection/Adapters/ConnectionMysqliAdapter.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -2,36 +2,36 @@
 block discarded – undo
2 2
 	jRequire("ConnectionInterface.php");
3 3
 	class ConnectionMysqliAdapter implements ConnectionAdapterInterface {
4 4
 			public $connection;
5
-			public function __construct( $_srv, $_db, $_usr, $_pass ) {
6
-				$this->connection = new mysqli( $_srv, $_usr, $_pass, $_db );
5
+			public function __construct($_srv, $_db, $_usr, $_pass) {
6
+				$this->connection = new mysqli($_srv, $_usr, $_pass, $_db);
7 7
 			}
8
-			public function query( $_query ) {
8
+			public function query($_query) {
9 9
 				$this->stdQuery($_query);
10 10
 				return true;
11 11
 			}
12
-			public function queryInsert( $_query ) {
12
+			public function queryInsert($_query) {
13 13
 				$this->stdQuery($_query);
14 14
 				return $this->connection->insert_id;
15 15
 			}
16
-			public function queryFetch( $_query ) {
16
+			public function queryFetch($_query) {
17 17
 				$result = $this->stdQuery($_query);
18 18
 				$rows = [];
19
-				while($row = $result->fetch_assoc())
19
+				while ($row = $result->fetch_assoc())
20 20
 					$rows[] = $row;
21 21
 				return $rows;
22 22
 			}
23
-			public function queryArray( $_query ) {
23
+			public function queryArray($_query) {
24 24
 				$result = $this->stdQuery($_query);
25 25
 				$rows = [];
26
-				while($row = $result->fetch_array())
26
+				while ($row = $result->fetch_array())
27 27
 					$rows[] = $row;
28 28
 				return $rows;
29 29
 			}
30
-			protected function stdQuery( $_query ) {
30
+			protected function stdQuery($_query) {
31 31
 				$database = $this->connection;
32 32
 				$error = "Error query [$_query]";
33 33
 				$result = $database->query($_query);
34
-				if(!$result) {
34
+				if (!$result) {
35 35
 					echo "$_query<br>";
36 36
 					echo "Something wrong: $error";
37 37
 					var_dump($database->error);
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,15 +16,17 @@
 block discarded – undo
16 16
 			public function queryFetch( $_query ) {
17 17
 				$result = $this->stdQuery($_query);
18 18
 				$rows = [];
19
-				while($row = $result->fetch_assoc())
20
-					$rows[] = $row;
19
+				while($row = $result->fetch_assoc()) {
20
+									$rows[] = $row;
21
+				}
21 22
 				return $rows;
22 23
 			}
23 24
 			public function queryArray( $_query ) {
24 25
 				$result = $this->stdQuery($_query);
25 26
 				$rows = [];
26
-				while($row = $result->fetch_array())
27
-					$rows[] = $row;
27
+				while($row = $result->fetch_array()) {
28
+									$rows[] = $row;
29
+				}
28 30
 				return $rows;
29 31
 			}
30 32
 			protected function stdQuery( $_query ) {
Please login to merge, or discard this patch.
dist/jate/modules/Connection/Adapters/ConnectionPdoAdapter.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -2,32 +2,32 @@
 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
 				$connection = "mysql:host=$_srv;dbname=$_db";
7
-				$this->connection = new PDO( $connection, $_usr, $_pass, [PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"] );
7
+				$this->connection = new PDO($connection, $_usr, $_pass, [PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"]);
8 8
 			}
9
-			public function query( $_query ) {
9
+			public function query($_query) {
10 10
 				$this->stdQuery($_query);
11 11
 				return true;
12 12
 			}
13
-			public function queryInsert( $_query ) {
13
+			public function queryInsert($_query) {
14 14
 				$this->stdQuery($_query);
15 15
 				return $this->connection->lastInsertId();
16 16
 			}
17
-			public function queryFetch( $_query ) {
17
+			public function queryFetch($_query) {
18 18
 				$temp = $this->stdQuery($_query);
19 19
 				return $temp->fetchAll(PDO::FETCH_ASSOC);
20 20
 			}
21
-			public function queryArray( $_query ) {
21
+			public function queryArray($_query) {
22 22
 				$temp = $this->stdQuery($_query);
23 23
 				return $temp->fetchAll(PDO::FETCH_COLUMN, 0);
24 24
 			}
25
-			protected function stdQuery( $_query ) {
25
+			protected function stdQuery($_query) {
26 26
 				$database = $this->connection;
27 27
 				$error = "Error query [$_query]";
28 28
 				$query = $database->prepare($_query);
29 29
 				$result = $query->execute();
30
-				if(!$result) {
30
+				if (!$result) {
31 31
 					echo "$_query<br>";
32 32
 					echo "Something wrong: $error";
33 33
 					var_dump($query->errorInfo());
Please login to merge, or discard this patch.
dist/jate/modules/Query/Query.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,27 +8,27 @@
 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
 			$this->connection["$_name"] = $_connection;
13 13
 			$this->currentConnection = $_connection;
14 14
 
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
 		}
19
-		public function setConnection( $_name ) {
19
+		public function setConnection($_name) {
20 20
 			$this->currentConnection = $this->connection["$_name"];
21 21
 		}
22
-		public function query( $_query ) {
22
+		public function query($_query) {
23 23
 			return $this->currentConnection->database->query($_query);
24 24
 		}
25
-		public function queryInsert( $_query ) {
25
+		public function queryInsert($_query) {
26 26
 			return $this->currentConnection->database->queryInsert($_query);
27 27
 		}
28
-		public function queryFetch( $_query ) {
28
+		public function queryFetch($_query) {
29 29
 			return $this->currentConnection->database->queryFetch($_query);
30 30
 		}
31
-		public function queryArray( $_query ) {
31
+		public function queryArray($_query) {
32 32
 			return $this->currentConnection->database->queryArray($_query);
33 33
 		}
34 34
 	}
Please login to merge, or discard this patch.