| 1 | <?php |
||
| 2 | |||
| 3 | /** |
||
| 4 | * For the full copyright and license information, please view |
||
| 5 | * the LICENSE file that was distributed with this source code. |
||
| 6 | * |
||
| 7 | * @see https://github.com/ecphp |
||
| 8 | */ |
||
| 9 | |||
| 10 | declare(strict_types=1); |
||
| 11 | |||
| 12 | namespace EcPhp\ApiGwAuthenticationBundle\Controller; |
||
| 13 | |||
| 14 | use EcPhp\ApiGwAuthenticationBundle\Security\Core\User\ApiGwAuthenticationUser; |
||
| 15 | use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface; |
||
| 16 | use Symfony\Component\HttpFoundation\JsonResponse; |
||
| 17 | |||
| 18 | final class Token |
||
| 19 | { |
||
| 20 | public function __invoke(JWTTokenManagerInterface $jwtManager): JsonResponse |
||
| 21 | { |
||
| 22 | $username = uniqid('user_'); |
||
| 23 | |||
| 24 | $payload = [ |
||
| 25 | 'iat' => time(), |
||
| 26 | 'sub' => $username, |
||
| 27 | 'jti' => uniqid(), |
||
| 28 | 'iss' => '/api/token', |
||
| 29 | 'foo' => 'bar', |
||
| 30 | ]; |
||
| 31 | |||
| 32 | $user = new ApiGwAuthenticationUser($username); |
||
| 33 | |||
| 34 | return new JsonResponse( |
||
| 35 | [ |
||
| 36 | 'token' => $jwtManager->createFromPayload($user, $payload), |
||
|
0 ignored issues
–
show
|
|||
| 37 | ] |
||
| 38 | ); |
||
| 39 | } |
||
| 40 | } |
||
| 41 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.