DBALObjectRepository   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 6
dl 0
loc 22
rs 10
c 1
b 0
f 1
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A tableName() 0 3 1
A __construct() 0 3 1
A createObject() 0 3 1
A connection() 0 3 1
1
<?php
2
3
namespace Zenstruck\Porpaginas\Tests\Doctrine\Fixtures;
4
5
use Doctrine\DBAL\Connection;
6
use Zenstruck\Porpaginas\Doctrine\Repository\DBALMatchableObjectRepository;
7
8
/**
9
 * @author Kevin Bond <[email protected]>
10
 */
11
final class DBALObjectRepository extends DBALMatchableObjectRepository
12
{
13
    private Connection $connection;
14
15
    public function __construct(Connection $connection)
16
    {
17
        $this->connection = $connection;
18
    }
19
20
    protected static function createObject(array $data): object
21
    {
22
        return new DBALObject($data['value']);
23
    }
24
25
    protected static function tableName(): string
26
    {
27
        return 'ORMEntity';
28
    }
29
30
    protected function connection(): Connection
31
    {
32
        return $this->connection;
33
    }
34
}
35