@@ -86,10 +86,10 @@ private function logQuery(Connection $connection, $result): void
8686 if ($ result instanceof Result) {
8787 $ this ->totalTime += $ result ->getTime ();
8888 if ($ this ->count < $ this ->maxQueries ) {
89- $ this ->events [] = [$ connection , $ result ->getQueryString (), $ result -> getParameters (), $ trace , $ result ->getTime (), $ result ->getRowCount (), null ];
89+ $ this ->events [] = [$ connection , $ result ->getQuery (), $ trace , $ result ->getTime (), $ result ->getRowCount (), null ];
9090 }
9191 } elseif ($ result instanceof DriverException && $ this ->count < $ this ->maxQueries ) {
92- $ this ->events [] = [$ connection , $ result ->getQueryString (), null , $ trace , null , null , $ result ->getMessage ()];
92+ $ this ->events [] = [$ connection , $ result ->getQuery () , $ trace , null , null , $ result ->getMessage ()];
9393 }
9494 }
9595
@@ -100,10 +100,9 @@ public static function renderException(?\Throwable $e): ?array
100100 return null ;
101101 }
102102
103- $ sql = $ e ->getQueryString ();
104- return $ sql ? [
103+ return $ e ->getQuery () ? [
105104 'tab ' => 'SQL ' ,
106- 'panel ' => Helpers::dumpSql ($ sql , $ e ->params ?? [] ),
105+ 'panel ' => Helpers::dumpSql ($ e ->getQuery () ),
107106 ] : null ;
108107 }
109108
@@ -127,8 +126,9 @@ public function getPanel(): ?string
127126
128127 $ events = [];
129128 foreach ($ this ->events as $ event ) {
130- [$ connection , $ sql , $ params , , , , $ error ] = $ event ;
129+ [$ connection , $ query , , , , $ error ] = $ event ;
131130 $ explain = null ;
131+ $ sql = $ query ->getSql ();
132132 $ command = preg_match ('#\s*\(?\s*(SELECT|INSERT|UPDATE|DELETE)\s#iA ' , $ sql , $ m )
133133 ? strtolower ($ m [1 ])
134134 : null ;
@@ -137,7 +137,7 @@ public function getPanel(): ?string
137137 $ cmd = is_string ($ this ->explain )
138138 ? $ this ->explain
139139 : 'EXPLAIN ' ;
140- $ rows = $ connection ->getConnection ()->query ("$ cmd $ sql " , $ params );
140+ $ rows = $ connection ->getConnection ()->query ("$ cmd $ sql " , $ query -> getParameters () );
141141 for ($ explain = []; $ row = $ rows ->fetch (); $ explain [] = $ row );
142142 } catch (DriverException ) {
143143 }
0 commit comments