From 6fab13aa0866aab484818b839fea9b97de8438bd Mon Sep 17 00:00:00 2001 From: David Nahodyl Date: Fri, 6 Sep 2024 15:57:20 -0400 Subject: [PATCH] moved bindings function to a variable for readability --- src/Services/FileMakerConnection.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Services/FileMakerConnection.php b/src/Services/FileMakerConnection.php index abc5b7d..abaf85d 100644 --- a/src/Services/FileMakerConnection.php +++ b/src/Services/FileMakerConnection.php @@ -764,11 +764,13 @@ protected function logFMQuery($method, $url, $params, $start) $sql .= "\nData: " . json_encode($params, JSON_PRETTY_PRINT); } + $bindings = collect(data_get($params, 'query', []))->flatMap( + fn (array $binding, $index) => collect($binding)->mapWithKeys(fn ($value, $key) => [$index . ': ' . $key => $value]) + )->all(); + $this->event(new QueryExecuted( $sql, - collect(data_get($params, 'query', []))->flatMap( - fn (array $binding, $index) => collect($binding)->mapWithKeys(fn ($value, $key) => [$index.': '.$key => $value]) - )->all(), + $bindings, $this->getElapsedTime($start), $this, )); @@ -816,7 +818,7 @@ public function setRetries($retries) protected function getDefaultQueryGrammar() { - return new FMGrammar(); + return new FMGrammar; } // public function getLayoutMetadata($layout = null)