Total Complexity | 5 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Coverage | 63.64% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | class Connection extends PDOConnection |
||
17 | { |
||
18 | /** |
||
19 | 42 | * {@inheritDoc} |
|
20 | */ |
||
21 | 42 | public function getSequenceNumber(string $name) : string |
|
22 | 42 | { |
|
23 | 42 | $stmt = $this->prepare('SELECT CONVERT(VARCHAR(MAX), current_value) FROM sys.sequences WHERE name = ?'); |
|
24 | $stmt->execute([$name]); |
||
25 | |||
26 | $sequenceNumber = $stmt->fetchColumn(); |
||
27 | |||
28 | 3 | if ($sequenceNumber === false) { |
|
29 | throw new PDOException('No sequence with name "' . $name . '" found.'); |
||
30 | 3 | } |
|
31 | 3 | ||
32 | return (string) $sequenceNumber; |
||
33 | } |
||
34 | 2 | ||
35 | 2 | /** |
|
36 | * {@inheritDoc} |
||
37 | 2 | */ |
|
38 | public function quote(string $input) : string |
||
48 | 31 | } |
|
49 | |||
50 | /** |
||
51 | * {@inheritDoc} |
||
52 | 31 | */ |
|
53 | protected function createStatement(\PDOStatement $stmt) : PDOStatement |
||
56 | } |
||
57 | } |
||
58 |