@@ -104,11 +104,11 @@ public function query(
104104 #[Language('MySQL ' )]
105105 string $ query
106106 ) {
107- return $ this ->getQueryLoggers ()->logRegion ($ query , function () use ( $ query ) {
108- return $ this ->buildQueryStatement ($ query , function ($ query ) {
109- return $ this ->pdo ->query ($ query );
110- });
111- } );
107+ return $ this ->getQueryLoggers ()->logRegion ($ query , fn () =>
108+ $ this ->buildQueryStatement ($ query , fn ($ query ) =>
109+ $ this ->pdo ->query ($ query )
110+ )
111+ );
112112 }
113113
114114 /**
@@ -119,9 +119,9 @@ public function prepare(
119119 #[Language('MySQL ' )]
120120 string $ query
121121 ) {
122- return $ this ->buildQueryStatement ((string ) $ query , function ($ query ) {
123- return $ this ->pdo ->prepare ($ query );
124- } );
122+ return $ this ->buildQueryStatement ((string ) $ query , fn ($ query ) =>
123+ $ this ->pdo ->prepare ($ query )
124+ );
125125 }
126126
127127 /**
@@ -134,17 +134,17 @@ public function exec(
134134 string $ query ,
135135 array $ params = []
136136 ): int {
137- return $ this ->getQueryLoggers ()->logRegion ($ query , function () use ( $ query , $ params ) {
138- return $ this ->exceptionHandler (function () use ($ query , $ params ) {
137+ return $ this ->getQueryLoggers ()->logRegion ($ query , fn () =>
138+ $ this ->exceptionHandler (function () use ($ query , $ params ) {
139139 $ stmt = $ this ->pdo ->prepare ($ query );
140140 $ timer = microtime (true );
141141 $ stmt ->execute ($ params );
142142 $ this ->queryLoggers ->log ($ query , microtime (true ) - $ timer );
143143 $ result = $ stmt ->rowCount ();
144144 $ stmt ->closeCursor ();
145145 return $ result ;
146- });
147- } );
146+ })
147+ );
148148 }
149149
150150 /**
@@ -165,23 +165,23 @@ public function getTableFields(string $table): array {
165165 return $ this ->tableFields [$ fqTable ];
166166 }
167167 $ query = "DESCRIBE {$ fqTable }" ;
168- return $ this ->getQueryLoggers ()->logRegion ($ query , function () use ( $ query , $ fqTable ) {
169- return $ this ->exceptionHandler (function () use ($ query , $ fqTable ) {
168+ return $ this ->getQueryLoggers ()->logRegion ($ query , fn () =>
169+ $ this ->exceptionHandler (function () use ($ query , $ fqTable ) {
170170 $ stmt = $ this ->pdo ->query ($ query );
171171 try {
172172 if ($ stmt === false ) {
173173 throw new RuntimeException ('Invalid return type ' );
174174 }
175175 $ rows = $ stmt ->fetchAll (PDO ::FETCH_ASSOC );
176- $ this ->tableFields [$ fqTable ] = array_map (static function ($ row ) { return $ row ['Field ' ]; } , $ rows ?: []);
176+ $ this ->tableFields [$ fqTable ] = array_map (static fn ($ row ) => $ row ['Field ' ], $ rows ?: []);
177177 return $ this ->tableFields [$ fqTable ];
178178 } finally {
179179 try {
180180 $ stmt ->closeCursor ();
181181 } catch (Throwable $ e ) {}
182182 }
183- });
184- } );
183+ })
184+ );
185185 }
186186
187187 /**
0 commit comments