Completed
Push — 2.0 ( afe19a...325c55 )
by Kirill
03:06
created
server/app/Models/User.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * For the full copyright and license information, please view the LICENSE
7 7
  * file that was distributed with this source code.
8 8
  */
9
-declare(strict_types=1);
9
+declare(strict_types = 1);
10 10
 
11 11
 namespace App\Models;
12 12
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             $avatar = self::DEFAULT_AVATAR_NAME;
67 67
         }
68 68
 
69
-        return self::DEFAULT_AVATAR_PATH . $avatar;
69
+        return self::DEFAULT_AVATAR_PATH.$avatar;
70 70
     }
71 71
 
72 72
     /**
@@ -90,6 +90,6 @@  discard block
 block discarded – undo
90 90
      */
91 91
     public function isGuest(): bool
92 92
     {
93
-        return 0 === (int)$this->getAuthIdentifier();
93
+        return 0 === (int) $this->getAuthIdentifier();
94 94
     }
95 95
 }
Please login to merge, or discard this patch.
server/app/Services/TokenAuth.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  * For the full copyright and license information, please view the LICENSE
5 5
  * file that was distributed with this source code.
6 6
  */
7
-declare(strict_types=1);
7
+declare(strict_types = 1);
8 8
 
9 9
 namespace App\Services;
10 10
 
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
      * @param string $password
52 52
      * @return Authenticatable
53 53
      */
54
-    public function attemptFromEmailAndPassword(string $email, string $password): ?Authenticatable
54
+    public function attemptFromEmailAndPassword(string $email, string $password): ? Authenticatable
55 55
     {
56
-        if (! $this->guard->validate(['email' => $email, 'password' => $password])) {
56
+        if (!$this->guard->validate(['email' => $email, 'password' => $password])) {
57 57
             return null;
58 58
         }
59 59
 
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
      * @param string $password
66 66
      * @return Authenticatable
67 67
      */
68
-    public function resolveFromIdAndPassword(int $id, string $password): ?Authenticatable
68
+    public function resolveFromIdAndPassword(int $id, string $password): ? Authenticatable
69 69
     {
70
-        if (! $this->guard->validate(['id' => $id, 'password' => $password])) {
70
+        if (!$this->guard->validate(['id' => $id, 'password' => $password])) {
71 71
             return null;
72 72
         }
73 73
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
                 'password' => $user->getAuthPassword(),
96 96
             ],
97 97
             'created' => Carbon::now()->toRfc3339String(),
98
-            'guest'   => 0 === (int)$user->getAuthIdentifier(),
98
+            'guest'   => 0 === (int) $user->getAuthIdentifier(),
99 99
             'token'   => $user->getRememberToken(),
100 100
         ]);
101 101
     }
@@ -173,9 +173,9 @@  discard block
 block discarded – undo
173 173
     private function resolveExistingUser(array $userInfo)
174 174
     {
175 175
         [$id, $password, $token] = [
176
-            (int)Arr::get($userInfo, 'user.id'),
177
-            (string)Arr::get($userInfo, 'user.password'),
178
-            (string)Arr::get($userInfo, 'token'),
176
+            (int) Arr::get($userInfo, 'user.id'),
177
+            (string) Arr::get($userInfo, 'user.password'),
178
+            (string) Arr::get($userInfo, 'token'),
179 179
         ];
180 180
 
181 181
         $user = User::where('id', $id)->where('password', $password)->first();
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
             throw new UnprocessableEntityHttpException('Invalid remember token');
185 185
         }
186 186
 
187
-        if (! $user) {
187
+        if (!$user) {
188 188
             throw new UnprocessableEntityHttpException('Invalid user credentials.');
189 189
         }
190 190
 
Please login to merge, or discard this patch.
server/app/GraphQL/Queries/AuthQuery.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  * For the full copyright and license information, please view the LICENSE
5 5
  * file that was distributed with this source code.
6 6
  */
7
-declare(strict_types=1);
7
+declare(strict_types = 1);
8 8
 
9 9
 namespace App\GraphQL\Queries;
10 10
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 
107 107
         $user = $this->tokenAuth->attemptFromEmailAndPassword($email, $password);
108 108
 
109
-        if (! $user) {
109
+        if (!$user) {
110 110
             throw new AccessDeniedHttpException('User password are not correct');
111 111
         }
112 112
 
Please login to merge, or discard this patch.