1 | <?php |
||
22 | class PostgresDriver extends Driver |
||
23 | { |
||
24 | /** |
||
25 | * Driver type. |
||
26 | */ |
||
27 | const TYPE = DatabaseInterface::POSTGRES; |
||
28 | |||
29 | /** |
||
30 | * Driver schemas. |
||
31 | */ |
||
32 | //const SCHEMA_TABLE = TableSchema::class; |
||
33 | |||
34 | /** |
||
35 | * Commander used to execute commands. :). |
||
36 | */ |
||
37 | //const COMMANDER = Commander::class; |
||
38 | |||
39 | /** |
||
40 | * Query compiler class. |
||
41 | */ |
||
42 | const QUERY_COMPILER = QueryCompiler::class; |
||
43 | |||
44 | /** |
||
45 | * Default timestamp expression. |
||
46 | */ |
||
47 | const TIMESTAMP_NOW = 'now()'; |
||
48 | |||
49 | /** |
||
50 | * Cached list of primary keys associated with their table names. Used by InsertBuilder to |
||
51 | * emulate last insert id. |
||
52 | * |
||
53 | * @var array |
||
54 | */ |
||
55 | private $primaryKeys = []; |
||
56 | |||
57 | /** |
||
58 | * {@inheritdoc} |
||
59 | */ |
||
60 | public function hasTable(string $name): bool |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | public function truncateData(string $table) |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | public function tableNames(): array |
||
89 | |||
90 | /** |
||
91 | * Get singular primary key associated with desired table. Used to emulate last insert id. |
||
92 | * |
||
93 | * @param string $prefix Database prefix if any. |
||
94 | * @param string $table Fully specified table name, including postfix. |
||
95 | * |
||
96 | * @return string|null |
||
97 | * |
||
98 | * @throws DriverException |
||
99 | */ |
||
100 | public function getPrimary(string $prefix, string $table): string |
||
132 | |||
133 | /** |
||
134 | * {@inheritdoc} |
||
135 | * |
||
136 | * Postgres uses custom insert query builder in order to return value of inserted row. |
||
137 | */ |
||
138 | public function insertBuilder(string $prefix, array $parameters = []): InsertQuery |
||
145 | |||
146 | /** |
||
147 | * {@inheritdoc} |
||
148 | */ |
||
149 | protected function createPDO(): \PDO |
||
157 | } |
||
158 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.