@@ -33,9 +33,9 @@ class QueryCollector extends PDOCollector
3333 ];
3434
3535 /**
36- * @param TimeDataCollector $timeCollector
36+ * @param TimeDataCollector|null $timeCollector
3737 */
38- public function __construct (TimeDataCollector $ timeCollector = null )
38+ public function __construct (? TimeDataCollector $ timeCollector = null )
3939 {
4040 $ this ->timeCollector = $ timeCollector ;
4141 }
@@ -79,7 +79,7 @@ public function setShowCopyButton($enabled = true)
7979 */
8080 public function setFindSource ($ value , array $ middleware )
8181 {
82- $ this ->findSource = (bool ) $ value ;
82+ $ this ->findSource = (bool )$ value ;
8383 $ this ->middleware = $ middleware ;
8484 }
8585
@@ -96,7 +96,7 @@ public function mergeBacktraceExcludePaths(array $excludePaths)
9696 /**
9797 * Enable/disable the shaded duration background on queries
9898 *
99- * @param bool $enabled
99+ * @param bool $enabled
100100 */
101101 public function setDurationBackground ($ enabled )
102102 {
@@ -106,8 +106,8 @@ public function setDurationBackground($enabled)
106106 /**
107107 * Enable/disable the EXPLAIN queries
108108 *
109- * @param bool $enabled
110- * @param array|null $types Array of types to explain queries (select/insert/update/delete)
109+ * @param bool $enabled
110+ * @param array|null $types Array of types to explain queries (select/insert/update/delete)
111111 */
112112 public function setExplainSource ($ enabled , $ types )
113113 {
@@ -162,7 +162,7 @@ public function addQuery($query, $bindings, $time, $connection)
162162 if (!is_int ($ binding ) && !is_float ($ binding )) {
163163 if ($ pdo ) {
164164 try {
165- $ binding = $ pdo ->quote ((string ) $ binding );
165+ $ binding = $ pdo ->quote ((string )$ binding );
166166 } catch (\Exception ) {
167167 $ binding = $ this ->emulateQuote ($ binding );
168168 }
@@ -171,7 +171,7 @@ public function addQuery($query, $bindings, $time, $connection)
171171 }
172172 }
173173
174- $ query = preg_replace ($ regex , addcslashes ($ binding , '$ ' ), (string ) $ query , 1 );
174+ $ query = preg_replace ($ regex , addcslashes ($ binding , '$ ' ), (string )$ query , 1 );
175175 }
176176 }
177177
@@ -210,10 +210,10 @@ public function addQuery($query, $bindings, $time, $connection)
210210 */
211211 protected function emulateQuote ($ value )
212212 {
213- $ search = ["\\" , "\x00" , "\n" , "\r" , "' " , '" ' , "\x1a" ];
214- $ replace = ["\\\\" ,"\\0 " ,"\\n " , "\\r " , "\' " , '\" ' , "\\Z " ];
213+ $ search = ["\\" , "\x00" , "\n" , "\r" , "' " , '" ' , "\x1a" ];
214+ $ replace = ["\\\\" , "\\0 " , "\\n " , "\\r " , "\' " , '\" ' , "\\Z " ];
215215
216- return "' " . str_replace ($ search , $ replace , (string ) $ value ) . "' " ;
216+ return "' " . str_replace ($ search , $ replace , (string )$ value ) . "' " ;
217217 }
218218
219219 /**
@@ -280,13 +280,13 @@ protected function findSource()
280280 /**
281281 * Parse a trace element from the backtrace stack.
282282 *
283- * @param int $index
284- * @param array $trace
283+ * @param int $index
284+ * @param array $trace
285285 * @return object|bool
286286 */
287287 protected function parseTrace ($ index , array $ trace )
288288 {
289- $ frame = (object ) [
289+ $ frame = (object )[
290290 'index ' => $ index ,
291291 'namespace ' => null ,
292292 'name ' => null ,
@@ -311,7 +311,7 @@ protected function parseTrace($index, array $trace)
311311 } elseif (str_contains ($ file , base_path () . '/storage ' )) {
312312 $ hash = pathinfo ($ file , PATHINFO_FILENAME );
313313
314- if (! $ frame ->name = $ this ->findViewFromHash ($ hash )) {
314+ if (!$ frame ->name = $ this ->findViewFromHash ($ hash )) {
315315 $ frame ->name = $ hash ;
316316 }
317317
@@ -350,7 +350,7 @@ protected function fileIsInExcludedPath($file)
350350 $ normalizedPath = str_replace ('\\' , '/ ' , $ file );
351351
352352 foreach ($ this ->backtraceExcludePaths as $ excludedPath ) {
353- if (str_contains ($ normalizedPath , (string ) $ excludedPath )) {
353+ if (str_contains ($ normalizedPath , (string )$ excludedPath )) {
354354 return true ;
355355 }
356356 }
@@ -361,15 +361,15 @@ protected function fileIsInExcludedPath($file)
361361 /**
362362 * Find the middleware alias from the file.
363363 *
364- * @param string $file
364+ * @param string $file
365365 * @return string|null
366366 */
367367 protected function findMiddlewareFromFile ($ file )
368368 {
369369 $ filename = pathinfo ($ file , PATHINFO_FILENAME );
370370
371371 foreach ($ this ->middleware as $ alias => $ class ) {
372- if (str_contains ((string ) $ class , $ filename )) {
372+ if (str_contains ((string )$ class , $ filename )) {
373373 return $ alias ;
374374 }
375375 }
@@ -378,7 +378,7 @@ protected function findMiddlewareFromFile($file)
378378 /**
379379 * Find the template name from the hash.
380380 *
381- * @param string $hash
381+ * @param string $hash
382382 * @return null|string
383383 */
384384 protected function findViewFromHash ($ hash )
@@ -397,7 +397,7 @@ protected function findViewFromHash($hash)
397397 }
398398
399399 foreach ($ property ->getValue ($ finder ) as $ name => $ path ) {
400- if (sha1 ((string ) $ path ) == $ hash || md5 ((string ) $ path ) == $ hash ) {
400+ if (sha1 ((string )$ path ) == $ hash || md5 ((string )$ path ) == $ hash ) {
401401 return $ name ;
402402 }
403403 }
@@ -440,7 +440,7 @@ protected function normalizeFilename($path)
440440
441441 /**
442442 * Collect a database transaction event.
443- * @param string $event
443+ * @param string $event
444444 * @param \Illuminate\Database\Connection $connection
445445 * @return array
446446 */
@@ -586,4 +586,4 @@ public function getWidgets()
586586 ]
587587 ];
588588 }
589- }
589+ }
0 commit comments