DBALObjectRepository::connection()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 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