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

LoadClientData::getOrder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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