Test Failed
Push — master ( 6f640b...9bd92d )
by Federico
02:56
created
dist/jate/modules/Connection/Connection.php 1 patch
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -1,49 +1,49 @@
 block discarded – undo
1 1
 <?php
2 2
   requireComponents("Adapters");
3 3
   class Connection {
4
-    public $database;
5
-    public $info;
6
-    public function __construct( $_object ) {
7
-      if(!is_object($_object))
8
-        throw new InvalidArgumentException("Parameter must be an object.");
9
-      $this->setConnection(
10
-        $_object->server,
11
-        $_object->database,
12
-        $_object->user,
13
-        $_object->password,
14
-        $this->getConnectionType($_object->engine)
15
-      );
16
-    }
17
-    protected function setConnection ( $_srv, $_db, $_usr, $_pass, $_type ) {
18
-      switch ($_type) {
19
-        case "mysqli":
20
-          $this->database = new MysqliAdapter($_srv, $_db, $_usr, $_pass);
21
-        break;
22
-        case "postgresql":
23
-          $this->database = new PostgresqlAdapter($_srv, $_db, $_usr, $_pass);
24
-        break;
25
-        case "memory":
26
-          $this->database = new PdoMemoryAdapter($_srv, $_db, $_usr, $_pass);
27
-        break;
28
-        case "pdo":
29
-        default:
30
-          $this->database = new PdoAdapter($_srv, $_db, $_usr, $_pass);
31
-        break;
32
-      }
33
-      $this->info = [
34
-        "srv"  => $_srv,
35
-        "db"   => $_db,
36
-        "usr"  => $_usr,
37
-        "pass" => $_pass,
38
-        "type" => $_type
39
-      ];
40
-    }
41
-    protected function getConnectionType( $_type ) {
42
-      $array = (array)$_type;
43
-      foreach ($array as $key => $value)
44
-        if($value)
45
-          return $key;
46
-      return "pdo";
47
-    }
4
+	public $database;
5
+	public $info;
6
+	public function __construct( $_object ) {
7
+	  if(!is_object($_object))
8
+		throw new InvalidArgumentException("Parameter must be an object.");
9
+	  $this->setConnection(
10
+		$_object->server,
11
+		$_object->database,
12
+		$_object->user,
13
+		$_object->password,
14
+		$this->getConnectionType($_object->engine)
15
+	  );
16
+	}
17
+	protected function setConnection ( $_srv, $_db, $_usr, $_pass, $_type ) {
18
+	  switch ($_type) {
19
+		case "mysqli":
20
+		  $this->database = new MysqliAdapter($_srv, $_db, $_usr, $_pass);
21
+		break;
22
+		case "postgresql":
23
+		  $this->database = new PostgresqlAdapter($_srv, $_db, $_usr, $_pass);
24
+		break;
25
+		case "memory":
26
+		  $this->database = new PdoMemoryAdapter($_srv, $_db, $_usr, $_pass);
27
+		break;
28
+		case "pdo":
29
+		default:
30
+		  $this->database = new PdoAdapter($_srv, $_db, $_usr, $_pass);
31
+		break;
32
+	  }
33
+	  $this->info = [
34
+		"srv"  => $_srv,
35
+		"db"   => $_db,
36
+		"usr"  => $_usr,
37
+		"pass" => $_pass,
38
+		"type" => $_type
39
+	  ];
40
+	}
41
+	protected function getConnectionType( $_type ) {
42
+	  $array = (array)$_type;
43
+	  foreach ($array as $key => $value)
44
+		if($value)
45
+		  return $key;
46
+	  return "pdo";
47
+	}
48 48
   }
49 49
 ?>
Please login to merge, or discard this patch.