Failed Conditions
Pull Request — develop (#3368)
by Benjamin
51:03 queued 47:13
created

Connection::getSequenceNumber()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 5
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Doctrine\DBAL\Driver\PDOSqlite;
4
5
use Doctrine\DBAL\Driver\DriverException;
6
use Doctrine\DBAL\Driver\PDOConnection;
7
8
/**
9
 * SQLite Connection implementation.
10
 */
11
class Connection extends PDOConnection
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16 1
    public function getSequenceNumber(string $name) : string
17
    {
18
        // SQLite does not support sequences. However, PDO::lastInsertId() ignores the name parameter, and returns
19
        // the last insert ID even if a sequence name is given. We expect an exception in that case.
20 1
        throw new DriverException('SQLite does not support sequences.');
21
    }
22
}
23