8000 Fix argument types for Illuminate/Database/Query/Builder::upsert() by jellisii · Pull Request #55849 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content

Fix argument types for Illuminate/Database/Query/Builder::upsert() #55849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 26, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix argument types for Illuminate/Database/Query/Builder::upsert()
Ensures IDE hinting isn't out of order.
  • Loading branch information
jellisii committed May 23, 2025
commit 76753088391921e41f43da8cc9dd8211725290a7
8 changes: 3 additions & 5 deletions src/Illuminate/Database/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Carbon\CarbonPeriod;
use Closure;
use DateTimeInterface;
use function Illuminate\Support\enum_value;
use Illuminate\Contracts\Database\Query\Builder as BuilderContract;
use Illuminate\Contracts\Database\Query\ConditionExpression;
use Illuminate\Contracts\Database\Query\Expression as ExpressionContract;
Expand All @@ -28,9 +29,8 @@
use InvalidArgumentException;
use LogicException;
use RuntimeException;
use UnitEnum;

use function Illuminate\Support\enum_value;
use UnitEnum;

class Builder implements BuilderContract
{
Expand Down Expand Up @@ -3898,11 +3898,9 @@ public function updateOrInsert(array $attributes, array|callable $values = [])
/**
* Insert new records or update the existing ones.
*
* @param array|string $uniqueBy
* @param array|null $update
* @return int
*/
public function upsert(array $values, $uniqueBy, $update = null)
public function upsert(array $values, array|string $uniqueBy, ?array $update = null)
{
if (empty($values)) {
return 0;
Expand Down
0