Completed
Push — ezp-31088-refactor-content-mod... ( ab3ba3 )
by
unknown
13:24 queued 33s
created

FallbackGateway   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getColumnNextIntegerValue() 0 7 1
A getLastInsertedId() 0 4 1
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
declare(strict_types=1);
8
9
namespace eZ\Publish\Core\Persistence\Legacy\SharedGateway\DatabasePlatform;
10
11
use Doctrine\DBAL\Connection;
12
use eZ\Publish\Core\Persistence\Legacy\SharedGateway\Gateway;
13
14
final class FallbackGateway implements Gateway
15
{
16
    /** @var \Doctrine\DBAL\Connection */
17
    private $connection;
18
19
    public function __construct(Connection $connection)
20
    {
21
        $this->connection = $connection;
22
    }
23
24
    public function getColumnNextIntegerValue(
25
        string $tableName,
26
        string $columnName,
27
        string $sequenceName
28
    ): ?int {
29
        return null;
30
    }
31
32
    public function getLastInsertedId(string $sequenceName): int
33
    {
34
        return (int)$this->connection->lastInsertId($sequenceName);
35
    }
36
}
37