@@ -1,9 +1,9 @@ discard block |
||
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; |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | 'passLogin' => $password |
15 | 15 | ); |
16 | 16 | $result = $obLogin->authLogin($data); |
17 | - if(isset($result)) |
|
17 | + if (isset($result)) |
|
18 | 18 | echo $result; |
19 | 19 | else |
20 | 20 | echo json_encode([]); |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once (dirname(__DIR__) . '/vendor/autoload.php'); |
|
3 | +require_once (dirname(__DIR__).'/vendor/autoload.php'); |
|
4 | 4 | use ChatApp\Session; |
5 | 5 | use Dotenv\Dotenv; |
6 | 6 | $dotenv = new Dotenv(dirname(__DIR__)); |
7 | 7 | $dotenv->load(); |
8 | 8 | |
9 | -if(Session::get('start') != null && empty($_GET['user'])) |
|
9 | +if (Session::get('start') != null && empty($_GET['user'])) |
|
10 | 10 | { |
11 | 11 | |
12 | 12 | ?> |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | |
175 | 175 | <?php |
176 | 176 | } |
177 | -else{ |
|
178 | - header('Location:'. getenv('APP_URL')."/index.php"); |
|
177 | +else { |
|
178 | + header('Location:'.getenv('APP_URL')."/index.php"); |
|
179 | 179 | } |
180 | 180 | ?> |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once (__DIR__ . '/vendor/autoload.php'); |
|
3 | +require_once (__DIR__.'/vendor/autoload.php'); |
|
4 | 4 | use ChatApp\Session; |
5 | 5 | use Dotenv\Dotenv; |
6 | 6 | $dotenv = new Dotenv(__DIR__); |
7 | 7 | $dotenv->load(); |
8 | 8 | |
9 | 9 | // die("Hello"); |
10 | -if(Session::get('start') != null) |
|
10 | +if (Session::get('start') != null) |
|
11 | 11 | { |
12 | 12 | header("Location:".getenv('APP_URL')."/views/account.php"); |
13 | 13 | } |
@@ -1,9 +1,9 @@ discard block |
||
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; |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | 'mob' => $mob |
21 | 21 | ); |
22 | 22 | $result = $obRegister->authRegister($data); |
23 | - if(isset($result)) |
|
23 | + if (isset($result)) |
|
24 | 24 | echo $result; |
25 | 25 | else |
26 | 26 | echo json_encode([]); |
@@ -190,12 +190,12 @@ discard block |
||
190 | 190 | "passLogin" => 'testing' |
191 | 191 | ] |
192 | 192 | ); |
193 | - $outputEmail = (array) json_decode($outputEmail); |
|
193 | + $outputEmail = (array)json_decode($outputEmail); |
|
194 | 194 | $this->assertEquals($expectedOutput, $outputEmail); |
195 | 195 | $currentId = Session::get('start'); |
196 | 196 | Session::forget('start'); |
197 | 197 | |
198 | - $msg =(object) [ |
|
198 | + $msg = (object)[ |
|
199 | 199 | "name" => $userId, |
200 | 200 | "reply" => "Hello World", |
201 | 201 | "userId" => $currentId |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $output = $obReply->replyTo($msg); |
206 | 206 | $this->assertEquals("Messages is sent", $output); |
207 | 207 | |
208 | - $msg =(object) [ |
|
208 | + $msg = (object)[ |
|
209 | 209 | "name" => $currentId, |
210 | 210 | "reply" => "Hello World", |
211 | 211 | "userId" => $userId |
@@ -218,14 +218,14 @@ discard block |
||
218 | 218 | $output = $obReply->replyTo([]); |
219 | 219 | $this->assertEquals("Failed", $output); |
220 | 220 | |
221 | - $output = $obReply->replyTo((object) [ |
|
221 | + $output = $obReply->replyTo((object)[ |
|
222 | 222 | "name" => -1, |
223 | 223 | "reply" => "Hello World", |
224 | 224 | "userId" => $currentId |
225 | 225 | ]); |
226 | 226 | $this->assertEquals("Invalid Authentication", $output); |
227 | 227 | |
228 | - $output = $obReply->replyTo((object) [ |
|
228 | + $output = $obReply->replyTo((object)[ |
|
229 | 229 | "name" => $userId, |
230 | 230 | "reply" => "Hello", |
231 | 231 | "userId" => $currentId |
@@ -65,7 +65,7 @@ |
||
65 | 65 | <div class="brief"> |
66 | 66 | <h1 id="name">Name: <?php echo $row['name']; ?></h1><br> |
67 | 67 | <?php foreach ($row as $key => $value) { |
68 | - if ($key =='username' && $value != null) { |
|
68 | + if ($key == 'username' && $value != null) { |
|
69 | 69 | echo '<p>Username: '.$row["username"].'</p><br>'; |
70 | 70 | } |
71 | 71 | if ($key == 'email' && $value != null) { |
@@ -76,7 +76,7 @@ |
||
76 | 76 | $this->conversation->conversationLoad($msg, $para) |
77 | 77 | ); |
78 | 78 | // $id1 = json_decode($msg)->details; |
79 | - for ($i = 1 ; $i < count($this->messages); $i++) { |
|
79 | + for ($i = 1; $i < count($this->messages); $i++) { |
|
80 | 80 | $this->messages[$i]->start = $id1; |
81 | 81 | } |
82 | 82 | $id2 = bin2hex(convert_uuencode($id2)); |