Completed
Pull Request — master (#28)
by
unknown
04:33
created

LoadClientData   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 3
dl 0
loc 23
ccs 11
cts 11
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getOrder() 0 4 1
A load() 0 12 1
1
<?php
2
3
namespace SMG\UserBundle\DataFixtures\ORM;
4
5
use SMG\OauthBundle\Entity\Client;
6
use Doctrine\Common\DataFixtures\AbstractFixture;
7
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
8
use Doctrine\Common\Persistence\ObjectManager;
9
10
/**
11
 * Adds one Video without- and one Video with Comments.
12
 */
13
class LoadClientData extends AbstractFixture implements OrderedFixtureInterface
14
{
15 2
    public function load(ObjectManager $objectManager)
16
    {
17 2
        $c1 = new Client();
18 2
        $c1->setAllowedGrantTypes(
19 2
            ['password', 'refresh_token', 'token']
20
        );
21 2
        $c1->setType('backend');
22 2
        $this->addReference('new-client', $c1);
23
24 2
        $objectManager->persist($c1);
25 2
        $objectManager->flush();
26 2
    }
27
28
    /**
29
     * load fixtures in ascending order.
30
     */
31 2
    public function getOrder()
32
    {
33 2
        return 2;
34
    }
35
}
36