ApplicationRepository::persist()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
ccs 0
cts 6
cp 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Majora\Component\OAuth\Repository\ORM;
4
5
use Majora\Component\OAuth\Model\ApplicationInterface;
6
use Majora\Component\OAuth\Repository\ApplicationRepositoryInterface;
7
use Majora\Framework\Repository\Doctrine\BaseDoctrineRepository;
8
9
/**
10
 * Application repository implementation.
11
 */
12
class ApplicationRepository extends BaseDoctrineRepository implements ApplicationRepositoryInterface
13
{
14
    /**
15
     * @see TokenRepositoryInterface::persist()
16
     */
17
    public function persist(ApplicationInterface $application)
18
    {
19
        $em = $this->getEntityManager();
20
21
        $em->persist($application);
22
        $em->flush();
23
    }
24
25
    /**
26
     * @see TokenRepositoryInterface::remove()
27
     */
28
    public function remove(ApplicationInterface $application)
29
    {
30
        $em = $this->getEntityManager();
31
32
        $em->remove($application);
33
        $em->flush();
34
    }
35
}
36