@@ -353,13 +353,12 @@ private static function constructPreHook(string $spanName, int $paramsOffset, Ca
353353
354354 private static function constructPostHook (int $ paramsOffset , CachedInstrumentation $ instrumentation , MySqliTracker $ tracker , $ obj , array $ params , mixed $ retVal , ?\Throwable $ exception )
355355 {
356-
357356 $ mysqliObject = null ;
358357
359358 if ($ obj && $ retVal !== false ) { // even if constructor fails, we will get and temporary object which will be assigned (or not) alter in user code
360359 $ mysqliObject = $ obj ;
361360 } elseif ($ retVal instanceof mysqli) { // procedural mode
362- $ mySqliObject = $ retVal ;
361+ $ mysqliObject = $ retVal ;
363362 } elseif ($ paramsOffset == self ::MYSQLI_REAL_CONNECT_ARG_OFFSET && $ retVal !== false && $ params [0 ] instanceof mysqli) { // real_connect procedural mode
364363 $ mysqliObject = $ params [0 ];
365364 }
@@ -369,7 +368,6 @@ private static function constructPostHook(int $paramsOffset, CachedInstrumentati
369368 }
370369
371370 self ::endSpan ([], $ exception , ($ retVal === false && !$ exception ) ? mysqli_connect_error () : null );
372-
373371 }
374372
375373 /** @param non-empty-string $spanName */
@@ -380,11 +378,11 @@ private static function queryPreHook(string $spanName, CachedInstrumentation $in
380378
381379 private static function queryPostHook (CachedInstrumentation $ instrumentation , MySqliTracker $ tracker , $ obj , array $ params , mixed $ retVal , ?\Throwable $ exception )
382380 {
383-
384381 $ mysqli = $ obj ? $ obj : $ params [0 ];
385382 $ query = $ obj ? $ params [0 ] : $ params [1 ];
386383
387384 $ attributes = $ tracker ->getMySqliAttributes ($ mysqli );
385+
388386 $ attributes [TraceAttributes::DB_STATEMENT ] = mb_convert_encoding ($ query , 'UTF-8 ' );
389387 $ attributes [TraceAttributes::DB_OPERATION_NAME ] = self ::extractQueryCommand ($ query );
390388
0 commit comments