Completed
Push — 2.0 ( b567d9...afe19a )
by Kirill
02:58
created
server/app/GraphQL/Serializers/UserSerializer.php 1 patch
Spacing   +2 added lines, -2 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\GraphQL\Serializers;
12 12
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     public function toArray($user): array
26 26
     {
27 27
         return [
28
-            'id'           => (int)$user->id,
28
+            'id'           => (int) $user->id,
29 29
             'name'         => $user->name,
30 30
             'email'        => $user->email,
31 31
             'avatar'       => $user->avatar,
Please login to merge, or discard this patch.
server/app/GraphQL/Mutations/AbstractMutation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 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\Mutations;
10 10
 
Please login to merge, or discard this patch.
server/app/GraphQL/Types/AuthUserType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 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\GraphQL\Types;
12 12
 
Please login to merge, or discard this patch.
server/app/GraphQL/Serializers/AuthUserSerializer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 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\GraphQL\Serializers;
12 12
 
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
 
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
      * @param string $password
55 55
      * @return Authenticatable
56 56
      */
57
-    public function attemptFromEmailAndPassword(string $email, string $password): ?Authenticatable
57
+    public function attemptFromEmailAndPassword(string $email, string $password): ? Authenticatable
58 58
     {
59
-        if (! $this->guard->validate(['email' => $email, 'password' => $password])) {
59
+        if (!$this->guard->validate(['email' => $email, 'password' => $password])) {
60 60
             return null;
61 61
         }
62 62
 
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
      * @param string $password
69 69
      * @return Authenticatable
70 70
      */
71
-    public function resolveFromIdAndPassword(int $id, string $password): ?Authenticatable
71
+    public function resolveFromIdAndPassword(int $id, string $password): ? Authenticatable
72 72
     {
73
-        if (! $this->guard->validate(['id' => $id, 'password' => $password])) {
73
+        if (!$this->guard->validate(['id' => $id, 'password' => $password])) {
74 74
             return null;
75 75
         }
76 76
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
                 'id'       => $user->getAuthIdentifier(),
98 98
                 'password' => $user->getAuthPassword(),
99 99
             ],
100
-            'guest' => 0 === (int)$user->getAuthIdentifier(),
100
+            'guest' => 0 === (int) $user->getAuthIdentifier(),
101 101
             'token' => $user->getRememberToken(),
102 102
         ]);
103 103
     }
@@ -159,9 +159,9 @@  discard block
 block discarded – undo
159 159
     private function resolveExistingUser(array $userInfo)
160 160
     {
161 161
         [$id, $password, $token] = [
162
-            (int)Arr::get($userInfo, 'user.id'),
163
-            (string)Arr::get($userInfo, 'user.password'),
164
-            (string)Arr::get($userInfo, 'token'),
162
+            (int) Arr::get($userInfo, 'user.id'),
163
+            (string) Arr::get($userInfo, 'user.password'),
164
+            (string) Arr::get($userInfo, 'token'),
165 165
         ];
166 166
 
167 167
         $user = User::where('id', $id)->where('password', $password)->first();
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
             throw new UnprocessableEntityHttpException('Invalid remember token');
171 171
         }
172 172
 
173
-        if (! $user) {
173
+        if (!$user) {
174 174
             throw new UnprocessableEntityHttpException('Invalid user credentials.');
175 175
         }
176 176
 
Please login to merge, or discard this patch.
server/app/GraphQL/Queries/AuthQuery.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,6 @@
 block discarded – undo
14 14
 use GraphQL\Type\Definition\Type;
15 15
 use App\GraphQL\Types\AuthUserType;
16 16
 use GraphQL\Type\Definition\ObjectType;
17
-use App\GraphQL\Serializers\UserSerializer;
18 17
 use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
19 18
 
20 19
 /**
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 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
 
@@ -110,12 +110,12 @@  discard block
 block discarded – undo
110 110
 
111 111
         $user = $this->tokenAuth->attemptFromEmailAndPassword($email, $password);
112 112
 
113
-        if (! $user) {
113
+        if (!$user) {
114 114
             throw new AccessDeniedHttpException('User password are not correct');
115 115
         }
116 116
 
117 117
         if (isset($args['remember']) && $this->guard instanceof StatefulGuard) {
118
-            $this->guard->login($user, (bool)$args['remember']);
118
+            $this->guard->login($user, (bool) $args['remember']);
119 119
         }
120 120
 
121 121
         return AuthUserSerializer::serialize($user);
Please login to merge, or discard this patch.
server/app/GraphQL/Queries/AbstractCollectionQuery.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 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\GraphQL\Queries;
12 12
 
Please login to merge, or discard this patch.