Passed
Pull Request — master (#49)
by
unknown
14:23
created

TagMapper::queueCreate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
c 0
b 0
f 0
nc 1
nop 3
dl 0
loc 8
rs 10
1
<?php
2
3
namespace App\Blog\Tag;
4
5
use Cycle\Annotated\Annotation\Column;
6
use Cycle\Annotated\Annotation\Table;
7
use Cycle\ORM\Command\ContextCarrierInterface;
8
use Cycle\ORM\Heap\Node;
9
use Cycle\ORM\Heap\State;
10
use Cycle\ORM\Mapper\Mapper;
11
12
class TagMapper extends Mapper
13
{
14
    public function queueCreate($entity, Node $node, State $state): ContextCarrierInterface
15
    {
16
        $command = parent::queueCreate($entity, $node, $state);
17
18
        $state->register('created_at', new \DateTimeImmutable(), true);
19
        $command->register('created_at', new \DateTimeImmutable(), true);
20
21
        return $command;
22
    }
23
}
24