Total Complexity | 9 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Coverage | 94.44% |
Changes | 0 |
1 | <?php |
||
13 | final class Connection extends AbstractConnection |
||
14 | { |
||
15 | 164 | public function createCommand(?string $sql = null, array $params = []): Command |
|
16 | { |
||
17 | 164 | if ($sql !== null) { |
|
18 | 164 | $sql = $this->quoteSql($sql); |
|
19 | } |
||
20 | |||
21 | 164 | $command = new Command($this, $sql); |
|
22 | |||
23 | 164 | return $command->bindValues($params); |
|
24 | } |
||
25 | |||
26 | /** |
||
27 | * Returns the schema information for the database opened by this connection. |
||
28 | * |
||
29 | * @return Schema the schema information for the database opened by this connection. |
||
30 | */ |
||
31 | 305 | public function getSchema(): Schema |
|
32 | { |
||
33 | 305 | return new Schema($this); |
|
34 | } |
||
35 | |||
36 | 204 | protected function createPdoInstance(): PDO |
|
37 | { |
||
38 | 204 | return new PDO($this->getDsn(), $this->getUsername(), $this->getPassword(), $this->getAttributes()); |
|
39 | } |
||
40 | |||
41 | 204 | protected function initConnection(): void |
|
50 | } |
||
51 | } |
||
52 | 204 | } |
|
53 | |||
54 | /** |
||
55 | * Returns the name of the DB driver. |
||
56 | * |
||
57 | * @return string name of the DB driver |
||
58 | */ |
||
59 | 7 | public function getDriverName(): string |
|
64 |