Passed
Push — develop ( 3f3e75...907aec )
by nguereza
03:12
created

OauthAccessToken::mapEntity()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 8
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Platine\Framework\OAuth2\Entity;
6
7
use Platine\Orm\Entity;
8
use Platine\Orm\Mapper\EntityMapperInterface;
9
10
/**
11
* @class OauthAccessToken
12
* @package Platine\Framework\OAuth2\Entity
13
*/
14
class OauthAccessToken extends Entity
15
{
16
    /**
17
    * {@inheritdoc}
18
    */
19
    public static function mapEntity(EntityMapperInterface $mapper): void
20
    {
21
         $mapper->primaryKey('access_token');
22
         $mapper->useTimestamp();
23
         $mapper->casts([
24
            'expires' => 'date',
25
            'created_at' => 'date',
26
            'updated_at' => '?date',
27
         ]);
28
    }
29
}
30