Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
56 | private static function getToken(): ?string |
||
57 | { |
||
58 | self::bootKernel(); |
||
59 | |||
60 | // returns the real and unchanged service container |
||
61 | $container = self::$kernel->getContainer(); |
||
62 | |||
63 | $data = ['username' => '[email protected]', 'roles' => ['ROLE_ADMIN']]; |
||
64 | |||
65 | try { |
||
66 | $token = $container |
||
67 | ->get('lexik_jwt_authentication.encoder') |
||
68 | ->encode($data); |
||
69 | } catch (JWTEncodeFailureException $e) { |
||
70 | echo $e->getMessage().PHP_EOL; |
||
71 | } |
||
72 | |||
73 | return $token; |
||
74 | } |
||
76 |