Completed
Push — master ( ab4ae0...06d3fe )
by Ankit
02:53
created
src/User.php 1 patch
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,18 +33,18 @@
 block discarded – undo
33 33
         if($para == True)
34 34
         {
35 35
             $this->query = "SELECT * from login where login_id = '$details'";
36
-        }
37
-        else
36
+        } else
38 37
         {
39 38
             $this->query = "SELECT * from login where username = '$details'";
40 39
         }
41 40
         $this->result = $this->connect->query($this->query);
42
-        if($this->result->num_rows > 0)                   // if true
41
+        if($this->result->num_rows > 0) {
42
+            // if true
43 43
         {
44 44
             $this->details = $this->result->fetch_assoc();
45
-            return $this->details;
46 45
         }
47
-        else
46
+            return $this->details;
47
+        } else
48 48
         {
49 49
             return NULL;
50 50
         }
Please login to merge, or discard this patch.
src/Conversation.php 1 patch
Spacing   +13 added lines, -13 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__) . '/vendor/autoload.php');
4
+require_once (dirname(__DIR__).'/vendor/autoload.php');
5 5
 use ChatApp\Time;
6 6
 use ChatApp\User;
7 7
 use Dotenv\Dotenv;
@@ -35,38 +35,38 @@  discard block
 block discarded – undo
35 35
     public function conversationLoad($msg, $para)
36 36
     {
37 37
         $msg = json_decode($msg);
38
-        if(!empty($msg))
38
+        if (!empty($msg))
39 39
         {
40 40
             $userId = $msg->userId;
41 41
             $add_load = 0;
42 42
             $details = $msg->details;
43 43
             $load = $msg->load;
44 44
 
45
-            if($para == True)
45
+            if ($para == True)
46 46
             {
47 47
                 $details = convert_uudecode(hex2bin($details));
48 48
             }
49 49
             $fetch = $this->obUser->userDetails($details, $para);
50 50
 
51
-            if($fetch != NULL)
51
+            if ($fetch != NULL)
52 52
             {
53 53
                 $login_id = (int)$fetch['login_id'];
54 54
 
55 55
                 // Unique Identifier
56
-                if($login_id > $userId)
56
+                if ($login_id > $userId)
57 57
                     $identifier = $userId.':'.$login_id;
58 58
                 else
59 59
                     $identifier = $login_id.':'.$userId;
60 60
 
61 61
                 $query = "SELECT total_messages from total_message where identifier = '$identifier'";
62
-                if($result = $this->connect->query($query))
62
+                if ($result = $this->connect->query($query))
63 63
                 {
64
-                    if($result->num_rows > 0)
64
+                    if ($result->num_rows > 0)
65 65
                     {
66 66
                         $total = $result->fetch_assoc();
67 67
                         $total = $total['total_messages'];
68
-                        if($total - $load > 0)
69
-                            if($total - $load > 10)
68
+                        if ($total - $load > 0)
69
+                            if ($total - $load > 10)
70 70
                                 $add_load = $load + 10;
71 71
                             else
72 72
                                 $add_load = $total;
@@ -74,14 +74,14 @@  discard block
 block discarded – undo
74 74
                 }
75 75
 
76 76
                 $query = "SELECT message, time, sent_by FROM messages WHERE identifier_message_number = '$identifier' ORDER BY id DESC limit ".$load;
77
-                if($result = $this->connect->query($query))
77
+                if ($result = $this->connect->query($query))
78 78
                 {
79
-                    if($result->num_rows > 0)
79
+                    if ($result->num_rows > 0)
80 80
                     {
81
-                        while($row = $result->fetch_assoc())
81
+                        while ($row = $result->fetch_assoc())
82 82
                         {
83 83
                             $row['time'] = $this->obTime->timeConversion($row['time']);
84
-                            $row = array_merge($row,['start' => $userId]);
84
+                            $row = array_merge($row, ['start' => $userId]);
85 85
                             $this->array = array_merge($this->array, [$row]);
86 86
                         }
87 87
 
Please login to merge, or discard this patch.