@@ -23,14 +23,13 @@ public function __construct(PDO $pdo)
2323 $ this ->pdo ->setAttribute (PDO ::ATTR_STATEMENT_CLASS , [TraceablePDOStatement::class, [$ this ]]);
2424 }
2525
26- /**
27- * Initiates a transaction
28- *
29- * @link http://php.net/manual/en/pdo.begintransaction.php
30- * @return bool TRUE on success or FALSE on failure.
31- */
32- #[\ReturnTypeWillChange]
33- public function beginTransaction ()
26+ /**
27+ * Initiates a transaction
28+ *
29+ * @link http://php.net/manual/en/pdo.begintransaction.php
30+ * @return bool TRUE on success or FALSE on failure.
31+ */
32+ public function beginTransaction () : bool
3433 {
3534 return $ this ->pdo ->beginTransaction ();
3635 }
@@ -41,8 +40,7 @@ public function beginTransaction()
4140 * @link http://php.net/manual/en/pdo.commit.php
4241 * @return bool TRUE on success or FALSE on failure.
4342 */
44- #[\ReturnTypeWillChange]
45- public function commit ()
43+ public function commit () : bool
4644 {
4745 return $ this ->pdo ->commit ();
4846 }
@@ -65,8 +63,7 @@ public function errorCode()
6563 * @link http://php.net/manual/en/pdo.errorinfo.php
6664 * @return array PDO::errorInfo returns an array of error information
6765 */
68- #[\ReturnTypeWillChange]
69- public function errorInfo ()
66+ public function errorInfo () : array
7067 {
7168 return $ this ->pdo ->errorInfo ();
7269 }
@@ -107,8 +104,7 @@ public function getAttribute($attribute)
107104 * @link http://php.net/manual/en/pdo.intransaction.php
108105 * @return bool TRUE if a transaction is currently active, and FALSE if not.
109106 */
110- #[\ReturnTypeWillChange]
111- public function inTransaction ()
107+ public function inTransaction () : bool
112108 {
113109 return $ this ->pdo ->inTransaction ();
114110 }
@@ -182,8 +178,7 @@ public function quote($string, $parameter_type = PDO::PARAM_STR)
182178 * @link http://php.net/manual/en/pdo.rollback.php
183179 * @return bool TRUE on success or FALSE on failure.
184180 */
185- #[\ReturnTypeWillChange]
186- public function rollBack ()
181+ public function rollBack () : bool
187182 {
188183 return $ this ->pdo ->rollBack ();
189184 }
@@ -196,8 +191,7 @@ public function rollBack()
196191 * @param mixed $value
197192 * @return bool TRUE on success or FALSE on failure.
198193 */
199- #[\ReturnTypeWillChange]
200- public function setAttribute ($ attribute , $ value )
194+ public function setAttribute ($ attribute , $ value ) : bool
201195 {
202196 return $ this ->pdo ->setAttribute ($ attribute , $ value );
203197 }
@@ -210,6 +204,7 @@ public function setAttribute($attribute, $value)
210204 * @param array $args
211205 * @return mixed The result of the call
212206 */
207+ #[\ReturnTypeWillChange]
213208 protected function profileCall ($ method , $ sql , array $ args )
214209 {
215210 $ trace = new TracedStatement ($ sql );
@@ -241,17 +236,17 @@ protected function profileCall($method, $sql, array $args)
241236 *
242237 * @param TracedStatement $stmt
243238 */
244- public function addExecutedStatement (TracedStatement $ stmt )
239+ public function addExecutedStatement (TracedStatement $ stmt ) : void
245240 {
246241 $ this ->executedStatements [] = $ stmt ;
247242 }
248243
249244 /**
250245 * Returns the accumulated execution time of statements
251246 *
252- * @return int
247+ * @return float
253248 */
254- public function getAccumulatedStatementsDuration ()
249+ public function getAccumulatedStatementsDuration () : float
255250 {
256251 return array_reduce ($ this ->executedStatements , function ($ v , $ s ) { return $ v + $ s ->getDuration (); });
257252 }
@@ -261,7 +256,7 @@ public function getAccumulatedStatementsDuration()
261256 *
262257 * @return int
263258 */
264- public function getMemoryUsage ()
259+ public function getMemoryUsage () : int
265260 {
266261 return array_reduce ($ this ->executedStatements , function ($ v , $ s ) { return $ v + $ s ->getMemoryUsage (); });
267262 }
@@ -271,7 +266,7 @@ public function getMemoryUsage()
271266 *
272267 * @return int
273268 */
274- public function getPeakMemoryUsage ()
269+ public function getPeakMemoryUsage () : int
275270 {
276271 return array_reduce ($ this ->executedStatements , function ($ v , $ s ) { $ m = $ s ->getEndMemory (); return $ m > $ v ? $ m : $ v ; });
277272 }
@@ -281,7 +276,7 @@ public function getPeakMemoryUsage()
281276 *
282277 * @return TracedStatement[]
283278 */
284- public function getExecutedStatements ()
279+ public function getExecutedStatements () : array
285280 {
286281 return $ this ->executedStatements ;
287282 }
@@ -291,7 +286,7 @@ public function getExecutedStatements()
291286 *
292287 * @return TracedStatement[]
293288 */
294- public function getFailedExecutedStatements ()
289+ public function getFailedExecutedStatements () : array
295290 {
296291 return array_filter ($ this ->executedStatements , function ($ s ) { return !$ s ->isSuccess (); });
297292 }
0 commit comments