@@ -87,10 +87,10 @@ private function logQuery(Connection $connection, $result): void
8787 if ($ result instanceof Result) {
8888 $ this ->totalTime += $ result ->getTime ();
8989 if ($ this ->count < $ this ->maxQueries ) {
90- $ this ->events [] = [$ connection , $ result ->getQueryString (), $ result -> getParameters (), $ trace , $ result ->getTime (), $ result ->getRowCount (), null ];
90+ $ this ->events [] = [$ connection , $ result ->getQuery (), $ trace , $ result ->getTime (), $ result ->getRowCount (), null ];
9191 }
9292 } elseif ($ result instanceof DriverException && $ this ->count < $ this ->maxQueries ) {
93- $ this ->events [] = [$ connection , $ result ->getQueryString (), null , $ trace , null , null , $ result ->getMessage ()];
93+ $ this ->events [] = [$ connection , $ result ->getQuery () , $ trace , null , null , $ result ->getMessage ()];
9494 }
9595 }
9696
@@ -101,10 +101,9 @@ public static function renderException(?\Throwable $e): ?array
101101 return null ;
102102 }
103103
104- $ sql = $ e ->getQueryString ();
105- return $ sql ? [
104+ return $ e ->getQuery () ? [
106105 'tab ' => 'SQL ' ,
107- 'panel ' => Helpers::dumpSql ($ sql , $ e ->params ?? [] ),
106+ 'panel ' => Helpers::dumpSql ($ e ->getQuery () ),
108107 ] : null ;
109108 }
110109
@@ -128,8 +127,9 @@ public function getPanel(): ?string
128127
129128 $ events = [];
130129 foreach ($ this ->events as $ event ) {
131- [$ connection , $ sql , $ params , , , , $ error ] = $ event ;
130+ [$ connection , $ query , , , , $ error ] = $ event ;
132131 $ explain = null ;
132+ $ sql = $ query ->getSql ();
133133 $ command = preg_match ('#\s*\(?\s*(SELECT|INSERT|UPDATE|DELETE)\s#iA ' , $ sql , $ m )
134134 ? strtolower ($ m [1 ])
135135 : null ;
@@ -138,7 +138,7 @@ public function getPanel(): ?string
138138 $ cmd = is_string ($ this ->explain )
139139 ? $ this ->explain
140140 : 'EXPLAIN ' ;
141- $ rows = $ connection ->getConnection ()->query ("$ cmd $ sql " , $ params );
141+ $ rows = $ connection ->getConnection ()->query ("$ cmd $ sql " , $ query -> getParameters () );
142142 for ($ explain = []; $ row = $ rows ->fetch (); $ explain [] = $ row );
143143 } catch (DriverException ) {
144144 }
0 commit comments