Repository navigation
Sync Laravel updates: cross-disk transfers, Eloquent and cache fixes #625
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
Changes from all commits
d7f9286
798b55d
563a92c
5b8c9c4
4c934a3
29cbe97
62eefbc
33c8e77
3730ca2
8fe79b1
61b0013
283ee53
0bb82b6
7aa51ef
7ae3a3c
dccfea4
538e5c9
bf3e365
6b110b1
4a398ba
e0edd9f
df836e0
fcfbcfa
c03b895
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -318,7 +318,9 @@ public function containsStrict(mixed $key, mixed $value = null): bool | |||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| if ($this->useAsCallable($key)) { | ||||||||||||||||
| return ! is_null($this->first($key)); | ||||||||||||||||
| $placeholder = new stdClass; | ||||||||||||||||
|
|
||||||||||||||||
| return $this->first($key, $placeholder) !== $placeholder; | ||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: The new Prompt for AI agents
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The complete source and type-fixture PHPStan checks pass with this branch as written. There is no reported type error to fix, so I am not adding a redundant callable annotation. |
||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| foreach ($this as $item) { | ||||||||||||||||
|
|
||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -146,7 +146,7 @@ public function ask(string $question, ?string $default = null): mixed | |||||
| /** | ||||||
| * Prompt the user for input with auto completion. | ||||||
| * | ||||||
| * @param (callable(string): string[])|iterable $choices | ||||||
| * @param (callable(string): list<string>)|iterable $choices | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: Prompt for AI agents
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Symfony QuestionHelper uses the callback result directly and indexes it with zero-based offsets during arrow-key selection. Sparse or string-keyed results do not satisfy that behavior. list accurately describes the supported callback result and matches upstream. |
||||||
| */ | ||||||
| public function anticipate(string $question, iterable|callable $choices, ?string $default = null): mixed | ||||||
| { | ||||||
|
|
@@ -156,7 +156,7 @@ public function anticipate(string $question, iterable|callable $choices, ?string | |||||
| /** | ||||||
| * Prompt the user for input with auto completion. | ||||||
| * | ||||||
| * @param (callable(string): string[])|iterable $choices | ||||||
| * @param (callable(string): list<string>)|iterable $choices | ||||||
| */ | ||||||
| public function askWithCompletion(string $question, iterable|callable $choices, ?string $default = null): mixed | ||||||
| { | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -522,11 +522,13 @@ protected function throwMissingAttributeExceptionIfApplicable(string $key): mixe | |||||
| && ! $this->wasRecentlyCreated | ||||||
| && static::preventsAccessingMissingAttributes() | ||||||
| && ! CoroutineContext::get(self::MISSING_ATTRIBUTE_ACCESS_SUPPRESSED_CONTEXT_KEY, false)) { | ||||||
| $exception = new MissingAttributeException($this, $key); | ||||||
|
|
||||||
| if (isset(static::$missingAttributeViolationCallback)) { | ||||||
| return call_user_func(static::$missingAttributeViolationCallback, $this, $key); | ||||||
| return call_user_func(static::$missingAttributeViolationCallback, $this, $key, $exception); | ||||||
| } | ||||||
|
|
||||||
| throw new MissingAttributeException($this, $key); | ||||||
| throw $exception; | ||||||
| } | ||||||
|
|
||||||
| return null; | ||||||
|
|
@@ -600,15 +602,22 @@ public function isRelation(string $key): bool | |||||
| */ | ||||||
| protected function handleLazyLoadingViolation(string $key): mixed | ||||||
| { | ||||||
| $exception = new LazyLoadingViolationException($this, $key); | ||||||
|
|
||||||
| if (isset(static::$lazyLoadingViolationCallback)) { | ||||||
| return call_user_func(static::$lazyLoadingViolationCallback, $this, $key); | ||||||
| return call_user_func( | ||||||
| static::$lazyLoadingViolationCallback, | ||||||
| $this, | ||||||
| $key, | ||||||
| $exception | ||||||
| ); | ||||||
| } | ||||||
|
|
||||||
| if (! $this->exists || $this->wasRecentlyCreated) { | ||||||
| return null; | ||||||
| } | ||||||
|
|
||||||
| throw new LazyLoadingViolationException($this, $key); | ||||||
| throw $exception; | ||||||
| } | ||||||
|
|
||||||
| /** | ||||||
|
|
@@ -1981,7 +1990,7 @@ public function getOriginal(?string $key = null, mixed $default = null): mixed | |||||
| { | ||||||
| return (new static)->setRawAttributes( | ||||||
| $this->original, | ||||||
| $sync = true | ||||||
| sync: true | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Keep this call positional because Prompt for AI agents
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The call and parameter name match current upstream. The named sync argument is part of the supported method API; changing that parameter name in an override also breaks callers using that API. No extra compatibility path is needed here. |
||||||
| )->getOriginalWithoutRewindingModel($key, $default); | ||||||
| } | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,17 +15,16 @@ trait MassPrunable | |
| */ | ||
| public function pruneAll(int $chunkSize = 1000): int | ||
| { | ||
| $query = tap($this->prunable(), function ($query) use ($chunkSize) { | ||
| $query->when(! $query->getQuery()->limit, function ($query) use ($chunkSize) { | ||
| $query->limit($chunkSize); | ||
| }); | ||
| $softDeletable = static::isSoftDeletable(); | ||
|
|
||
| $query = tap($this->prunable(), function (Builder $query) use ($chunkSize, $softDeletable): void { | ||
| $query->when($softDeletable, fn (Builder $query): Builder => $query->withTrashed()) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: Prompt for AI agents
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The default forceDelete() bypasses scopes, but custom Eloquent builders may apply them. withTrashed() expresses the intended pruning query for that extension point and matches upstream. The regression test still verifies that both active and soft-deleted rows are pruned. |
||
| ->when(! $query->getQuery()->limit, fn (Builder $query): Builder => $query->limit($chunkSize)); | ||
| }); | ||
|
|
||
| $total = 0; | ||
| $events = null; | ||
|
|
||
| $softDeletable = static::isSoftDeletable(); | ||
|
|
||
| do { | ||
| $total += $count = $softDeletable | ||
| ? $query->forceDelete() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3: Named arguments
data:/queue:resolve against the concrete method's parameter names at runtime, and PHP allows a class implementing theQueuecontract to legally rename its parameters (e.g.$payload) without breaking interface conformance. A custom queue driver with renamed parameters would then fatal withError: Unknown named parameter $data. The removed$data = ''assignment was unused after the call, so the cleanup can keep positional arguments to avoid the interop risk. Note upstream Laravel (Illuminate\Bus\Batch::add) still callsbulk($jobs->all(), $data = '', $this->options['queue'] ?? null)positionally.Prompt for AI agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current upstream Batch::add() already uses data: and queue: here. Those parameter names are part of the supported queue API. I am retaining the upstream call rather than supporting overrides that rename its named arguments.