From 75a42fa38774098fd6212684b2215e9cc308711a Mon Sep 17 00:00:00 2001 From: Michael Dyrynda Date: Tue, 7 Jan 2025 10:42:14 +1030 Subject: [PATCH] rename method consistent with other eloquent method names --- src/GeneratesUuid.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/GeneratesUuid.php b/src/GeneratesUuid.php index 530fb9d..a664bd4 100644 --- a/src/GeneratesUuid.php +++ b/src/GeneratesUuid.php @@ -122,7 +122,7 @@ public function resolveUuidVersion(): string */ public function scopeWhereUuid($query, $uuid, $uuidColumn = null): Builder { - $uuidColumn = $this->guessUuidColumn($uuidColumn); + $uuidColumn = $this->getUuidColumn($uuidColumn); $uuid = $this->prepareUuid($uuid, $uuidColumn); return $query->whereIn( @@ -140,7 +140,7 @@ public function scopeWhereUuid($query, $uuid, $uuidColumn = null): Builder */ public function scopeWhereNotUuid($query, $uuid, $uuidColumn = null): Builder { - $uuidColumn = $this->guessUuidColumn($uuidColumn); + $uuidColumn = $this->getUuidColumn($uuidColumn); $uuid = $this->prepareUuid($uuid, $uuidColumn); return $query->whereNotIn( @@ -185,14 +185,12 @@ protected function normaliseUuids($uuid): array return $uuid; } - /** * Guess UUID column based on model configurations or given uuid column * * @param ?string $uuidColumn - * @return string */ - protected function guessUuidColumn($uuidColumn = null): string + protected function getUuidColumn($uuidColumn = null): string { return ! is_null($uuidColumn) && in_array($uuidColumn, $this->uuidColumns()) ? $uuidColumn @@ -204,7 +202,6 @@ protected function guessUuidColumn($uuidColumn = null): string * * @param string|array $uuid * @param string $uuidColumn - * @return string|array */ protected function prepareUuid($uuid, $uuidColumn): array|string {