3333use LogicException ;
3434use mysqli ;
3535use mysqli_sql_exception ;
36+ use mysqli_warning ;
3637use RuntimeException ;
3738use SensitiveParameter ;
3839
@@ -198,7 +199,9 @@ protected function connect(
198199 if ($ this ->failoverIndex === null ) {
199200 $ this ->config = $ config ;
200201 }
201- \mysqli_report ($ config ['report ' ]);
202+ if (isset ($ config ['report ' ])) {
203+ \mysqli_report ($ config ['report ' ]);
204+ }
202205 $ this ->mysqli = new mysqli ();
203206 foreach ($ config ['options ' ] as $ option => $ value ) {
204207 $ this ->mysqli ->options ($ option , $ value );
@@ -345,17 +348,22 @@ public function getConfig() : array
345348 return $ this ->config ;
346349 }
347350
348- public function warnings () : int
351+ public function getWarningsCount () : int
349352 {
350353 return $ this ->mysqli ->warning_count ;
351354 }
352355
356+ public function getWarnings () : false | mysqli_warning
357+ {
358+ return $ this ->mysqli ->get_warnings ();
359+ }
360+
353361 /**
354362 * Get a list of the latest errors.
355363 *
356364 * @return array<int,array<string,mixed>>
357365 */
358- public function errors () : array
366+ public function getErrors () : array
359367 {
360368 return $ this ->mysqli ->error_list ;
361369 }
@@ -365,7 +373,7 @@ public function errors() : array
365373 *
366374 * @return string|null
367375 */
368- public function error () : ?string
376+ public function getError () : ?string
369377 {
370378 return $ this ->mysqli ->error ?: null ;
371379 }
@@ -595,7 +603,7 @@ public function with() : With
595603 return new With ($ this );
596604 }
597605
598- public function lastQuery () : string
606+ public function getLastQuery () : string
599607 {
600608 return $ this ->lastQuery ;
601609 }
@@ -711,7 +719,7 @@ public function transaction(callable $statements) : static
711719 *
712720 * @return int|string
713721 */
714- public function insertId () : int | string
722+ public function getInsertId () : int | string
715723 {
716724 return $ this ->mysqli ->insert_id ;
717725 }
@@ -801,7 +809,7 @@ protected function finalizeAddToDebug(
801809 $ this ->debugCollector ->addData ([
802810 'start ' => $ start ,
803811 'end ' => $ end ,
804- 'statement ' => $ this ->lastQuery (),
812+ 'statement ' => $ this ->getLastQuery (),
805813 'rows ' => $ rows ,
806814 'description ' => $ description ,
807815 ]);
0 commit comments