44namespace Doctrine \DBAL \Jaeger \Decorator ;
55
66use Closure ;
7+ use Doctrine \Common \EventManager ;
78use Doctrine \DBAL \Cache \QueryCacheProfile ;
9+ use Doctrine \DBAL \Configuration ;
810use Doctrine \DBAL \Connection ;
11+ use Doctrine \DBAL \Driver ;
12+ use Doctrine \DBAL \Driver \Connection as DriverConnection ;
13+ use Doctrine \DBAL \Exception ;
914use Doctrine \DBAL \ParameterType ;
15+ use Doctrine \DBAL \Platforms \AbstractPlatform ;
16+ use Doctrine \DBAL \Query \Expression \ExpressionBuilder ;
1017use Doctrine \DBAL \Query \QueryBuilder ;
1118use Doctrine \DBAL \Result ;
19+ use Doctrine \DBAL \Schema \AbstractSchemaManager ;
1220use Doctrine \DBAL \Statement ;
21+ use Doctrine \DBAL \Types \Type ;
1322
1423abstract class AbstractConnectionDecorator extends Connection
1524{
@@ -66,122 +75,142 @@ public function rollBack(): bool
6675 return $ this ->connection ->rollBack ();
6776 }
6877
69- public function errorCode ()
78+ public function getParams (): array
7079 {
71- return $ this ->connection ->errorCode ();
80+ return $ this ->connection ->getParams ();
7281 }
7382
74- public function errorInfo ()
83+ public function getDatabase (): ? string
7584 {
76- return $ this ->connection ->errorInfo ();
85+ return $ this ->connection ->getDatabase ();
7786 }
7887
79- public function getParams ()
88+ public function getDriver (): Driver
8089 {
81- return $ this ->connection ->getParams ();
90+ return $ this ->connection ->getDriver ();
8291 }
8392
84- public function getDatabase ()
93+ public function getConfiguration (): Configuration
8594 {
86- return $ this ->connection ->getDatabase ();
95+ return $ this ->connection ->getConfiguration ();
8796 }
8897
89- public function getHost ()
98+ public function getEventManager (): EventManager
9099 {
91- return $ this ->connection ->getHost ();
100+ return $ this ->connection ->getEventManager ();
92101 }
93102
94- public function getPort ()
103+ public function getDatabasePlatform (): AbstractPlatform
95104 {
96- return $ this ->connection ->getPort ();
105+ return $ this ->connection ->getDatabasePlatform ();
97106 }
98107
99- public function getUsername ()
108+ public function getExpressionBuilder (): ExpressionBuilder
100109 {
101- return $ this ->connection ->getUsername ();
110+ return $ this ->connection ->getExpressionBuilder ();
102111 }
103112
104- public function getPassword ()
113+ public function createExpressionBuilder (): ExpressionBuilder
105114 {
106- return $ this ->connection ->getPassword ();
115+ return $ this ->connection ->createExpressionBuilder ();
107116 }
108117
109- public function getDriver ()
118+ public function connect (): bool
110119 {
111- return $ this ->connection ->getDriver ();
120+ return $ this ->connection ->connect ();
112121 }
113122
114- public function getConfiguration ()
123+ public function isAutoCommit (): bool
115124 {
116- return $ this ->connection ->getConfiguration ();
125+ return $ this ->connection ->isAutoCommit ();
117126 }
118127
119- public function getEventManager ()
128+ public function setAutoCommit ( $ autoCommit ): void
120129 {
121- return $ this ->connection ->getEventManager ( );
130+ $ this ->connection ->setAutoCommit ( $ autoCommit );
122131 }
123132
124- public function getDatabasePlatform ( )
133+ public function fetchAssociative ( string $ query , array $ params = [], array $ types = [] )
125134 {
126- return $ this ->connection ->getDatabasePlatform ( );
135+ return $ this ->connection ->fetchAssociative ( $ query , $ params , $ types );
127136 }
128137
129- public function getExpressionBuilder ( )
138+ public function fetchNumeric ( string $ query , array $ params = [], array $ types = [] )
130139 {
131- return $ this ->connection ->getExpressionBuilder ( );
140+ return $ this ->connection ->fetchNumeric ( $ query , $ params , $ types );
132141 }
133142
134- public function connect (): bool
143+ public function fetchOne ( string $ query , array $ params = [], array $ types = [])
135144 {
136- return $ this ->connection ->connect ( );
145+ return $ this ->connection ->fetchOne ( $ query , $ params , $ types );
137146 }
138147
139- public function isAutoCommit ()
148+ public function fetchAllNumeric ( string $ query , array $ params = [], array $ types = []): array
140149 {
141- return $ this ->connection ->isAutoCommit ( );
150+ return $ this ->connection ->fetchAllNumeric ( $ query , $ params , $ types );
142151 }
143152
144- public function setAutoCommit ( $ autoCommit )
153+ public function fetchAllAssociative ( string $ query , array $ params = [], array $ types = []): array
145154 {
146- $ this ->connection ->setAutoCommit ($ autoCommit );
155+ return $ this ->connection ->fetchAllAssociative ($ query , $ params , $ types );
156+ }
157+
158+ public function fetchAllKeyValue (string $ query , array $ params = [], array $ types = []): array
159+ {
160+ return $ this ->connection ->fetchAllKeyValue ($ query , $ params , $ types );
147161 }
148162
149- public function setFetchMode ( $ fetchMode )
163+ public function fetchAllAssociativeIndexed ( string $ query , array $ params = [], array $ types = []): array
150164 {
151- $ this ->connection ->setFetchMode ( $ fetchMode );
165+ return $ this ->connection ->fetchAllAssociativeIndexed ( $ query , $ params , $ types );
152166 }
153167
154- public function fetchAssoc ( $ statement , array $ params = [], array $ types = [])
168+ public function fetchFirstColumn ( string $ query , array $ params = [], array $ types = []): array
155169 {
156- return $ this ->connection ->fetchAssoc ( $ statement , $ params , $ types );
170+ return $ this ->connection ->fetchFirstColumn ( $ query , $ params , $ types );
157171 }
158172
159- public function fetchArray ( $ statement , array $ params = [], array $ types = [])
173+ public function iterateNumeric ( string $ query , array $ params = [], array $ types = []): \ Traversable
160174 {
161- return $ this ->connection ->fetchArray ( $ statement , $ params , $ types );
175+ return $ this ->connection ->iterateNumeric ( $ query , $ params , $ types );
162176 }
163177
164- public function fetchColumn ( $ statement , array $ params = [], $ column = 0 , array $ types = [])
178+ public function iterateAssociative ( string $ query , array $ params = [], array $ types = []): \ Traversable
165179 {
166- return $ this ->connection ->fetchColumn ( $ statement , $ params, $ column , $ types );
180+ return $ this ->connection ->iterateAssociative ( $ query , $ params , $ types );
167181 }
168182
169- public function isConnected ()
183+ public function iterateKeyValue (string $ query , array $ params = [], array $ types = []): \Traversable
184+ {
185+ return $ this ->connection ->iterateKeyValue ($ query , $ params , $ types );
186+ }
187+
188+ public function iterateAssociativeIndexed (string $ query , array $ params = [], array $ types = []): \Traversable
189+ {
190+ return $ this ->connection ->iterateAssociativeIndexed ($ query , $ params , $ types );
191+ }
192+
193+ public function iterateColumn (string $ query , array $ params = [], array $ types = []): \Traversable
194+ {
195+ return $ this ->connection ->iterateColumn ($ query , $ params , $ types );
196+ }
197+
198+ public function isConnected (): bool
170199 {
171200 return $ this ->connection ->isConnected ();
172201 }
173202
174- public function isTransactionActive ()
203+ public function isTransactionActive (): bool
175204 {
176205 return $ this ->connection ->isTransactionActive ();
177206 }
178207
179- public function delete ($ tableExpression , array $ identifier , array $ types = [])
208+ public function delete ($ table , array $ criteria , array $ types = [])
180209 {
181- return $ this ->connection ->delete ($ tableExpression , $ identifier , $ types );
210+ return $ this ->connection ->delete ($ table , $ criteria , $ types );
182211 }
183212
184- public function close ()
213+ public function close (): void
185214 {
186215 $ this ->connection ->close ();
187216 }
@@ -191,52 +220,47 @@ public function setTransactionIsolation($level)
191220 $ this ->connection ->setTransactionIsolation ($ level );
192221 }
193222
194- public function getTransactionIsolation ()
223+ public function getTransactionIsolation (): int
195224 {
196225 return $ this ->connection ->getTransactionIsolation ();
197226 }
198227
199- public function update ($ tableExpression , array $ data , array $ identifier , array $ types = [])
228+ public function update ($ table , array $ data , array $ criteria , array $ types = [])
200229 {
201- return $ this ->connection ->update ($ tableExpression , $ data , $ identifier , $ types );
230+ return $ this ->connection ->update ($ table , $ data , $ criteria , $ types );
202231 }
203232
204- public function insert ($ tableExpression , array $ data , array $ types = [])
233+ public function insert ($ table , array $ data , array $ types = [])
205234 {
206- return $ this ->connection ->insert ($ tableExpression , $ data , $ types );
235+ return $ this ->connection ->insert ($ table , $ data , $ types );
207236 }
208237
209- public function quoteIdentifier ($ str )
238+ public function quoteIdentifier ($ str ): string
210239 {
211240 return $ this ->connection ->quoteIdentifier ($ str );
212241 }
213242
214- public function fetchAll ($ sql , array $ params = [], $ types = [])
215- {
216- return $ this ->connection ->fetchAll ($ sql , $ params , $ types );
217- }
218-
219243 public function executeQuery (string $ sql , array $ params = [], $ types = [], QueryCacheProfile $ qcp = null ): Result
220244 {
221245 return $ this ->connection ->executeQuery ($ sql , $ params , $ types , $ qcp );
222246 }
223247
224- public function executeCacheQuery ($ query , $ params , $ types , QueryCacheProfile $ qcp )
248+ public function executeCacheQuery ($ sql , $ params , $ types , QueryCacheProfile $ qcp ): Result
225249 {
226- return $ this ->connection ->executeCacheQuery ($ query , $ params , $ types , $ qcp );
250+ return $ this ->connection ->executeCacheQuery ($ sql , $ params , $ types , $ qcp );
227251 }
228252
229- public function project ( $ query , array $ params, Closure $ function )
253+ public function executeStatement ( $ sql , array $ params = [], array $ types = [] )
230254 {
231- return $ this ->connection ->project ( $ query , $ params , $ function );
255+ return $ this ->connection ->executeStatement ( $ sql , $ params , $ types );
232256 }
233257
234258 public function executeUpdate (string $ sql , array $ params = [], array $ types = []): int
235259 {
236260 return $ this ->connection ->executeUpdate ($ sql , $ params , $ types );
237261 }
238262
239- public function getTransactionNestingLevel ()
263+ public function getTransactionNestingLevel (): int
240264 {
241265 return $ this ->connection ->getTransactionNestingLevel ();
242266 }
@@ -246,47 +270,57 @@ public function transactional(Closure $func)
246270 return $ this ->connection ->transactional ($ func );
247271 }
248272
249- public function setNestTransactionsWithSavepoints ($ nestTransactionsWithSavepoints )
273+ public function setNestTransactionsWithSavepoints ($ nestTransactionsWithSavepoints ): void
250274 {
251275 $ this ->connection ->setNestTransactionsWithSavepoints ($ nestTransactionsWithSavepoints );
252276 }
253277
254- public function getNestTransactionsWithSavepoints ()
278+ public function getNestTransactionsWithSavepoints (): bool
255279 {
256280 return $ this ->connection ->getNestTransactionsWithSavepoints ();
257281 }
258282
259- public function createSavepoint ($ savepoint )
283+ public function createSavepoint ($ savepoint ): void
260284 {
261285 $ this ->connection ->createSavepoint ($ savepoint );
262286 }
263287
264- public function releaseSavepoint ($ savepoint )
288+ public function releaseSavepoint ($ savepoint ): void
265289 {
266290 $ this ->connection ->releaseSavepoint ($ savepoint );
267291 }
268292
269- public function rollbackSavepoint ($ savepoint )
293+ public function rollbackSavepoint ($ savepoint ): void
270294 {
271295 $ this ->connection ->rollbackSavepoint ($ savepoint );
272296 }
273297
274- public function getWrappedConnection ()
298+ public function getWrappedConnection (): DriverConnection
275299 {
276300 return $ this ->connection ->getWrappedConnection ();
277301 }
278302
279- public function getSchemaManager ()
303+ public function getNativeConnection ()
304+ {
305+ return $ this ->connection ->getNativeConnection ();
306+ }
307+
308+ public function getSchemaManager (): AbstractSchemaManager
280309 {
281310 return $ this ->connection ->getSchemaManager ();
282311 }
283312
284- public function setRollbackOnly ()
313+ public function createSchemaManager (): AbstractSchemaManager
314+ {
315+ return $ this ->connection ->createSchemaManager ();
316+ }
317+
318+ public function setRollbackOnly (): void
285319 {
286320 $ this ->connection ->setRollbackOnly ();
287321 }
288322
289- public function isRollbackOnly ()
323+ public function isRollbackOnly (): bool
290324 {
291325 return $ this ->connection ->isRollbackOnly ();
292326 }
@@ -301,18 +335,8 @@ public function convertToPHPValue($value, $type)
301335 return $ this ->connection ->convertToPHPValue ($ value , $ type );
302336 }
303337
304- public function resolveParams (array $ params , array $ types )
305- {
306- return $ this ->connection ->resolveParams ($ params , $ types );
307- }
308-
309- public function createQueryBuilder ()
310- {
311- return new QueryBuilder ($ this );
312- }
313-
314- public function ping ()
338+ public function createQueryBuilder (): QueryBuilder
315339 {
316- return $ this ->connection ->ping ();
340+ return $ this ->connection ->createQueryBuilder ();
317341 }
318342}
0 commit comments