Test Setup Failed
Push — master ( a87e27...976b69 )
by Ankit
02:24
created
src/Online.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 namespace ChatApp;
4
-require_once (dirname(__DIR__) . '/config/database.php');
4
+require_once (dirname(__DIR__).'/config/database.php');
5 5
 
6 6
 /**
7 7
 * For checking online status
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     {
14 14
         $connect = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
15 15
         $query = "Update login set login_status = 1 where login_id = '$userId'";
16
-        if(!$connect->query($query));
16
+        if (!$connect->query($query));
17 17
             echo $connect->error;
18 18
         $connect->close();
19 19
     }
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     {
23 23
         $connect = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
24 24
         $query = "Update login set login_status = 0 where login_id = '$userId'";
25
-        if(!$connect->query($query));
25
+        if (!$connect->query($query));
26 26
             echo $connect->error;
27 27
         $connect->close();
28 28
     }
Please login to merge, or discard this patch.
src/Receiver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 namespace ChatApp;
4
-require_once (dirname(__DIR__) . '/config/database.php');
4
+require_once (dirname(__DIR__).'/config/database.php');
5 5
 use ChatApp\User;
6 6
 use ChatApp\Time;
7 7
 use ChatApp\Conversation;
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         $name = $this->messages['name'];
32 32
         $this->messages = json_decode($this->conversation->ConversationLoad($msg, True));
33 33
         $id = json_decode($msg)->username;
34
-        for ($i=1 ; $i < count($this->messages); $i++) {
34
+        for ($i = 1; $i < count($this->messages); $i++) {
35 35
             $this->messages[$i]->start = $id;
36 36
         }
37 37
         $this->messages[0]->username = $username;
Please login to merge, or discard this patch.
src/Compose.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 namespace ChatApp;
4
-require_once (dirname(__DIR__) . '/config/database.php');
4
+require_once (dirname(__DIR__).'/config/database.php');
5 5
 
6 6
 /**
7 7
 *
@@ -23,18 +23,18 @@  discard block
 block discarded – undo
23 23
     public function SelectUser($msg)
24 24
     {
25 25
         $msg = $msg->value;
26
-        if(isset($_SESSION['start']) && isset($msg))
26
+        if (isset($_SESSION['start']) && isset($msg))
27 27
         {
28 28
             $id = $_SESSION['start'];
29 29
             $suggestion = trim($msg);
30
-            if($suggestion != "" )
30
+            if ($suggestion != "")
31 31
             {
32 32
                 $query = "SELECT * FROM login where login_id != '$id' and name like '$suggestion%' ORDER BY name DESC";
33
-                if($result = $this->connect->query($query))
33
+                if ($result = $this->connect->query($query))
34 34
                 {
35
-                    if($result->num_rows > 0)
35
+                    if ($result->num_rows > 0)
36 36
                     {
37
-                        while($row = $result->fetch_assoc())
37
+                        while ($row = $result->fetch_assoc())
38 38
                         {
39 39
                             $this->array = array_merge($this->array, [$row]);
40 40
                         }
Please login to merge, or discard this patch.
src/Profile.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 namespace ChatApp;
4
-require_once (dirname(__DIR__) . '/config/database.php');
4
+require_once (dirname(__DIR__).'/config/database.php');
5 5
 
6 6
 /**
7 7
 * For retreiving User Profile
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
         $connect = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
15 15
         $query = "SELECT * from profile where login_id = '$userId'";
16 16
         $result = $connect->query($query);
17
-        if($result->num_rows > 0)                   // if true
17
+        if ($result->num_rows > 0)                   // if true
18 18
         {
19 19
             $details = $result->fetch_assoc();
20 20
             return $details;
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,12 +14,13 @@
 block discarded – undo
14 14
         $connect = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
15 15
         $query = "SELECT * from profile where login_id = '$userId'";
16 16
         $result = $connect->query($query);
17
-        if($result->num_rows > 0)                   // if true
17
+        if($result->num_rows > 0) {
18
+            // if true
18 19
         {
19 20
             $details = $result->fetch_assoc();
20
-            return $details;
21 21
         }
22
-        else
22
+            return $details;
23
+        } else
23 24
         {
24 25
             return NULL;
25 26
         }
Please login to merge, or discard this patch.
src/User.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 
4 4
 namespace ChatApp;
5
-require_once (dirname(__DIR__) . '/config/database.php');
5
+require_once (dirname(__DIR__).'/config/database.php');
6 6
 
7 7
 /**
8 8
 * For retreiving User Information
@@ -21,12 +21,12 @@  discard block
 block discarded – undo
21 21
 
22 22
     public function UserDetails($id, $para)
23 23
     {
24
-        if($para == True)
24
+        if ($para == True)
25 25
             $this->query = "SELECT * from login where login_id = '$id'";
26 26
         else
27 27
             $this->query = "SELECT * from login where username = '$id'";
28 28
         $this->result = $this->connect->query($this->query);
29
-        if($this->result->num_rows > 0)                   // if true
29
+        if ($this->result->num_rows > 0)                   // if true
30 30
         {
31 31
             $this->details = $this->result->fetch_assoc();
32 32
             return $this->details;
Please login to merge, or discard this patch.
logout.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-require (__DIR__ . '/vendor/autoload.php');
3
+require (__DIR__.'/vendor/autoload.php');
4 4
 use ChatApp\Session;
5 5
 
6
-if(Session::get('start') != null)
6
+if (Session::get('start') != null)
7 7
 {
8 8
     Session::forget('start');
9 9
     header('Location: index.php');
Please login to merge, or discard this patch.
ajax/validate_login.php 3 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -5,13 +5,13 @@
 block discarded – undo
5 5
 
6 6
 if(isset($_POST['q']))
7 7
 {
8
-	$loginField = json_decode($_POST['q']);
9
-	$login = $loginField->login;
10
-	$password = $loginField->password;
11
-	$obLogin = new Login();
12
-	$result = $obLogin->authLogin($login, $password);
13
-	if(isset($result))
14
-		echo $result;
15
-	else
16
-		echo json_encode([]);
8
+    $loginField = json_decode($_POST['q']);
9
+    $login = $loginField->login;
10
+    $password = $loginField->password;
11
+    $obLogin = new Login();
12
+    $result = $obLogin->authLogin($login, $password);
13
+    if(isset($result))
14
+        echo $result;
15
+    else
16
+        echo json_encode([]);
17 17
 }
18 18
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-require (dirname(__DIR__) . '/vendor/autoload.php');
3
+require (dirname(__DIR__).'/vendor/autoload.php');
4 4
 use ChatApp\Login;
5 5
 
6
-if(isset($_POST['q']))
6
+if (isset($_POST['q']))
7 7
 {
8 8
 	$loginField = json_decode($_POST['q']);
9 9
 	$login = $loginField->login;
10 10
 	$password = $loginField->password;
11 11
 	$obLogin = new Login();
12 12
 	$result = $obLogin->authLogin($login, $password);
13
-	if(isset($result))
13
+	if (isset($result))
14 14
 		echo $result;
15 15
 	else
16 16
 		echo json_encode([]);
Please login to merge, or discard this patch.
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,8 +10,9 @@
 block discarded – undo
10 10
 	$password = $loginField->password;
11 11
 	$obLogin = new Login();
12 12
 	$result = $obLogin->authLogin($login, $password);
13
-	if(isset($result))
14
-		echo $result;
15
-	else
16
-		echo json_encode([]);
17
-}
18 13
\ No newline at end of file
14
+	if(isset($result)) {
15
+			echo $result;
16
+	} else {
17
+			echo json_encode([]);
18
+	}
19
+	}
19 20
\ No newline at end of file
Please login to merge, or discard this patch.
ajax/validate_register.php 3 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -5,17 +5,17 @@
 block discarded – undo
5 5
 
6 6
 if(isset($_POST['q']))
7 7
 {
8
-	$registerField = json_decode($_POST['q']);
9
-	$name = $registerField->name;
10
-	$email = $registerField->email;
11
-	$username = $registerField->username;
12
-	$mob = $registerField->mob;
13
-	$password = $registerField->password;
14
-	$obRegister = new Register();
15
-	$result = $obRegister->authRegister($name, $email, $username, $password, $mob);
16
-	if(isset($result))
17
-		echo $result;
18
-	else
19
-		echo json_encode([]);
8
+    $registerField = json_decode($_POST['q']);
9
+    $name = $registerField->name;
10
+    $email = $registerField->email;
11
+    $username = $registerField->username;
12
+    $mob = $registerField->mob;
13
+    $password = $registerField->password;
14
+    $obRegister = new Register();
15
+    $result = $obRegister->authRegister($name, $email, $username, $password, $mob);
16
+    if(isset($result))
17
+        echo $result;
18
+    else
19
+        echo json_encode([]);
20 20
 }
21 21
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-require (dirname(__DIR__) . '/vendor/autoload.php');
3
+require (dirname(__DIR__).'/vendor/autoload.php');
4 4
 use ChatApp\Register;
5 5
 
6
-if(isset($_POST['q']))
6
+if (isset($_POST['q']))
7 7
 {
8 8
 	$registerField = json_decode($_POST['q']);
9 9
 	$name = $registerField->name;
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 	$password = $registerField->password;
14 14
 	$obRegister = new Register();
15 15
 	$result = $obRegister->authRegister($name, $email, $username, $password, $mob);
16
-	if(isset($result))
16
+	if (isset($result))
17 17
 		echo $result;
18 18
 	else
19 19
 		echo json_encode([]);
Please login to merge, or discard this patch.
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,9 +13,10 @@
 block discarded – undo
13 13
 	$password = $registerField->password;
14 14
 	$obRegister = new Register();
15 15
 	$result = $obRegister->authRegister($name, $email, $username, $password, $mob);
16
-	if(isset($result))
17
-		echo $result;
18
-	else
19
-		echo json_encode([]);
20
-}
16
+	if(isset($result)) {
17
+			echo $result;
18
+	} else {
19
+			echo json_encode([]);
20
+	}
21
+	}
21 22
 
Please login to merge, or discard this patch.