AbstractRepository   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 24
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A insert() 0 6 1
A update() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\ApiSkeleton\Repository;
6
7
use Chubbyphp\Model\Doctrine\DBAL\Repository\AbstractDoctrineRepository;
8
9
abstract class AbstractRepository extends AbstractDoctrineRepository
10
{
11
    /**
12
     * @param string $id
13
     * @param array  $row
14
     */
15
    protected function insert(string $id, array $row)
16
    {
17
        $row['createdAt'] = (new \DateTime())->format('Y-m-d H:i:s');
18
19
        parent::insert($id, $row);
20
    }
21
22
    /**
23
     * @param string $id
24
     * @param array  $row
25
     */
26
    protected function update(string $id, array $row)
27
    {
28
        $row['updatedAt'] = (new \DateTime())->format('Y-m-d H:i:s');
29
30
        parent::update($id, $row);
31
    }
32
}
33