Skip to content

Commit

Permalink
Optimized the code of `Hyperf\Database\Query\Grammars\Grammar::compil…
Browse files Browse the repository at this point in the history
…eUpdate`. (#7082)
  • Loading branch information
albertcht authored Sep 25, 2024
1 parent 7e4e66f commit 725e7a4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Query/Grammars/PostgresGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function compileInsertGetId(Builder $query, $values, $sequence): string
*
* @param mixed $values
*/
public function compileUpdate(Builder $query, $values): string
public function compileUpdate(Builder $query, array $values): string
{
$table = $this->wrapTable($query->from);

Expand Down Expand Up @@ -365,10 +365,8 @@ protected function compileLock(Builder $query, $value): string

/**
* Compile the columns for an update statement.
*
* @return string
*/
protected function compileUpdateColumns(Builder $query, array $values)
protected function compileUpdateColumns(Builder $query, array $values): string
{
return collect($values)->map(function ($value, $key) {
$column = last(explode('.', $key));
Expand Down

0 comments on commit 725e7a4

Please sign in to comment.