Completed
Push — nyx-refresh-token-orm-config ( 30c2e2...f6baea )
by Quentin
05:18
created

RefreshTokenRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A persist() 0 7 1
A remove() 0 7 1
1
<?php
2
3
namespace Majora\Component\OAuth\Repository\ORM;
4
5
use Majora\Component\OAuth\Repository\RefreshTokenRepositoryInterface;
6
7
/**
8
 * RefreshToken repository implementation.
9
 *
10
 * @see Majora\Component\OAuth\Repository\TokenRepositoryInterface
11
 */
12
class RefreshTokenRepository extends TokenRepository implements RefreshTokenRepositoryInterface
13
{
14
    /**
15
     * @see TokenRepositoryInterface::persist()
16
     */
17
    public function persist(RefreshTokenInterface $refreshToken)
18
    {
19
        $em = $this->getEntityManager();
20
21
        $em->persist($refreshToken);
22
        $em->flush();
23
    }
24
25
    /**
26
     * @see TokenRepositoryInterface::remove()
27
     */
28
    public function remove(RefreshTokenInterface $refreshToken)
29
    {
30
        $em = $this->getEntityManager();
31
32
        $em->remove($refreshToken);
33
        $em->flush();
34
    }
35
}
36