From bae84dfd7124ac51cce6cf986cd3f39323857c02 Mon Sep 17 00:00:00 2001 From: Houssain Amrani Date: Tue, 27 Dec 2022 18:44:59 +0100 Subject: [PATCH 1/4] fix: add .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ecdf2d7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +vendor +.idea From 9f72743df6102a51b31ad6f6530adacc6a6562e6 Mon Sep 17 00:00:00 2001 From: Houssain Amrani Date: Tue, 27 Dec 2022 18:45:50 +0100 Subject: [PATCH 2/4] docs: add docblocks to Utils --- src/Utils.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Utils.php b/src/Utils.php index 387835a..900d1ff 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -19,6 +19,12 @@ class Utils { + /** + * Format query comments. + * + * @param array $comments + * @return string + */ public static function formatComments(array $comments): string { if (empty($comments)) { @@ -34,6 +40,12 @@ public static function formatComments(array $comments): string ) . "*/"; } + /** + * Encode URL. + * + * @param string $input + * @return string + */ private static function customUrlEncode(string $input): string { $encodedString = urlencode($input); From 778f67bb21c53b4ff06208bc3b2ec77f78b18414 Mon Sep 17 00:00:00 2001 From: Houssain Amrani Date: Tue, 27 Dec 2022 18:46:10 +0100 Subject: [PATCH 3/4] docs: add docblock to Opentelemetry --- src/Opentelemetry.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Opentelemetry.php b/src/Opentelemetry.php index b793c48..d49da14 100644 --- a/src/Opentelemetry.php +++ b/src/Opentelemetry.php @@ -21,6 +21,11 @@ class Opentelemetry { + /** + * Get the underlying Opentelemetry values. + * + * @return array + */ public static function getOpentelemetryValues() { $carrier = []; From b97ac05291b9eef9841341241a1da3a733a272d0 Mon Sep 17 00:00:00 2001 From: Houssain Amrani Date: Tue, 27 Dec 2022 18:47:36 +0100 Subject: [PATCH 4/4] fix: Undefined array key "controller" --- src/Database/Connection.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Database/Connection.php b/src/Database/Connection.php index 790783f..fbd5bff 100644 --- a/src/Database/Connection.php +++ b/src/Database/Connection.php @@ -37,6 +37,12 @@ protected function run($query, $bindings, \Closure $callback) ); } + /** + * Append SQL comments to the underlying query. + * + * @param string $query + * @return string + */ private function appendSqlComments(string $query): string { static $configurationKey = 'google_sqlcommenter.include'; @@ -52,7 +58,7 @@ private function appendSqlComments(string $query): string if (config("{$configurationKey}.controller", true) && !empty($action['controller'])) { $comments['controller'] = explode("@", class_basename($action['controller']))[0]; } - if (config("{$configurationKey}.action", true) && !empty($action and $action['controller'] && str_contains($action['controller'], '@'))) { + if (config("{$configurationKey}.action", true) && !empty($action) && !empty($action['controller']) && str_contains($action['controller'], '@')) { $comments['action'] = explode("@", class_basename($action['controller']))[1]; } if (config("{$configurationKey}.route", true)) {