@@ -4,7 +4,7 @@ |
||
| 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 | |
@@ -6,7 +6,7 @@ |
||
| 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 | |
@@ -6,7 +6,7 @@ |
||
| 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 | |
@@ -14,7 +14,6 @@ |
||
| 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 | /** |
@@ -4,7 +4,7 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -6,7 +6,7 @@ |
||
| 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 | |
@@ -6,7 +6,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -4,7 +4,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |