Total Complexity | 5 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Coverage | 69.57% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | class Connection extends PDOConnection |
||
17 | { |
||
18 | /** |
||
19 | * {@inheritdoc} |
||
20 | */ |
||
21 | 42 | public function __construct($dsn, $user = null, $password = null, ?array $options = null) |
|
25 | 42 | } |
|
26 | |||
27 | /** |
||
28 | * {@inheritDoc} |
||
29 | */ |
||
30 | 3 | public function lastInsertId($name = null) |
|
31 | { |
||
32 | 3 | if ($name === null) { |
|
33 | 3 | return parent::lastInsertId($name); |
|
34 | } |
||
35 | |||
36 | 2 | $stmt = $this->prepare('SELECT CONVERT(VARCHAR(MAX), current_value) FROM sys.sequences WHERE name = ?'); |
|
37 | 2 | $stmt->execute([$name]); |
|
38 | 2 | $lastInsertId = $stmt->fetchColumn(); |
|
39 | 2 | assert(is_string($lastInsertId)); |
|
40 | |||
41 | 2 | return $lastInsertId; |
|
42 | } |
||
43 | |||
44 | /** |
||
45 | * {@inheritDoc} |
||
46 | */ |
||
47 | 31 | public function quote($value, $type = ParameterType::STRING) |
|
57 | } |
||
58 | } |
||
59 |