Completed
Pull Request — master (#17)
by Valentyn
13:24
created

OAuthFixtures   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 18
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A load() 0 8 1
1
<?php
2
3
namespace App\DataFixtures;
4
5
use Doctrine\Bundle\FixturesBundle\Fixture;
6
use Doctrine\Common\Persistence\ObjectManager;
7
use FOS\OAuthServerBundle\Model\ClientManagerInterface;
8
9
class OAuthFixtures extends Fixture
10
{
11
    private $OAuthClientManager;
12
13
    public function __construct(ClientManagerInterface $OAuthClientManager)
14
    {
15
        $this->OAuthClientManager = $OAuthClientManager;
16
    }
17
18
    public function load(ObjectManager $manager)
19
    {
20
        $clientManager = $this->OAuthClientManager;
21
        $client = $clientManager->createClient();
22
        $client->setRedirectUris(['http://127.0.0.1:8080/']);
23
        $client->setAllowedGrantTypes(['password']);
24
        $clientManager->updateClient($client);
25
    }
26
}