Passed
Push — master ( 319fcb...7a107a )
by Rafael
04:41
created

LexikJWTGenerator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 17
c 0
b 0
f 0
ccs 0
cts 8
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A generate() 0 5 1
1
<?php
2
/*******************************************************************************
3
 *  This file is part of the GraphQL Bundle package.
4
 *
5
 *  (c) YnloUltratech <[email protected]>
6
 *
7
 *  For the full copyright and license information, please view the LICENSE
8
 *  file that was distributed with this source code.
9
 ******************************************************************************/
10
11
namespace Ynlo\GraphQLBundle\Behat\Authentication\JWT;
12
13
use Symfony\Component\HttpKernel\Kernel;
14
15
class LexikJWTGenerator implements TokenGeneratorInterface
16
{
17
    /**
18
     * @var Kernel
19
     */
20
    protected $kernel;
21
22
    public function __construct(Kernel $kernel)
23
    {
24
        $this->kernel = $kernel;
25
    }
26
27
    public function generate($user)
28
    {
29
        $container = $this->kernel->getContainer();
30
31
        return $container->get('lexik_jwt_authentication.jwt_manager')->create($user);
32
    }
33
}
34