Test Failed
Push — master ( 0381fe...30a29a )
by Federico
02:04
created
dist/jate/modules/Connection/Adapters/ConnectionPostgresqlAdapter.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -2,39 +2,39 @@
 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
         $this->connection = pg_connect("host=$_srv dbname=$_db user=$_usr password=$_pass")
7 7
           or die('Could not connect: '.pg_last_error());
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->stdQuery("SELECT lastval()");
16 16
       }
17
-      public function queryFetch( $_query ) {
17
+      public function queryFetch($_query) {
18 18
         $result = $this->stdQuery($_query);
19 19
         $rows = [];
20
-        while($row = pg_fetch_assoc($result))
20
+        while ($row = pg_fetch_assoc($result))
21 21
           $rows[] = $row;
22 22
         pg_free_result($result);
23 23
         return $rows;
24 24
       }
25
-      public function queryArray( $_query ) {
25
+      public function queryArray($_query) {
26 26
         $result = $this->stdQuery($_query);
27 27
         $rows = [];
28
-        while($row = pg_fetch_array($result))
28
+        while ($row = pg_fetch_array($result))
29 29
           $rows[] = $row;
30 30
         pg_free_result($result);
31 31
         return $rows;
32 32
       }
33
-      protected function stdQuery( $_query ) {
33
+      protected function stdQuery($_query) {
34 34
         $database = $this->connection;
35 35
         $error = "Error query [$_query]";
36 36
         $result = pg_query($database, $_query);
37
-        if(!$result) {
37
+        if (!$result) {
38 38
           echo "$_query<br>";
39 39
           echo "Something wrong: $error";
40 40
           var_dump(pg_last_error());
Please login to merge, or discard this patch.