Skip to content

Commit

Permalink
removing the middleman to simplify the call stack. (#54216)
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedAlaa4611 authored Jan 16, 2025
1 parent 206700a commit 1472088
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Cache/RedisStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ protected function currentTags($chunkSize = 1000)

$prefix = $connectionPrefix.$this->getPrefix();

return LazyCollection::make(function () use ($connection, $chunkSize, $prefix, $defaultCursorValue) {
return (new LazyCollection(function () use ($connection, $chunkSize, $prefix, $defaultCursorValue) {
$cursor = $defaultCursorValue;

do {
Expand All @@ -336,7 +336,7 @@ protected function currentTags($chunkSize = 1000)
yield $tag;
}
} while (((string) $cursor) !== $defaultCursorValue);
})->map(fn (string $tagKey) => Str::match('/^'.preg_quote($prefix, '/').'tag:(.*):entries$/', $tagKey));
}))->map(fn (string $tagKey) => Str::match('/^'.preg_quote($prefix, '/').'tag:(.*):entries$/', $tagKey));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Cache/RedisTagSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function entries()
default => '0',
};

return LazyCollection::make(function () use ($connection, $defaultCursorValue) {
return new LazyCollection(function () use ($connection, $defaultCursorValue) {
foreach ($this->tagIds() as $tagKey) {
$cursor = $defaultCursorValue;

Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Concerns/BuildsQueries.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public function lazy($chunkSize = 1000)

$this->enforceOrderBy();

return LazyCollection::make(function () use ($chunkSize) {
return new LazyCollection(function () use ($chunkSize) {
$page = 1;

while (true) {
Expand Down Expand Up @@ -304,7 +304,7 @@ protected function orderedLazyById($chunkSize = 1000, $column = null, $alias = n

$alias ??= $column;

return LazyCollection::make(function () use ($chunkSize, $column, $alias, $descending) {
return new LazyCollection(function () use ($chunkSize, $column, $alias, $descending) {
$lastId = null;

while (true) {
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Filesystem/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public function lines($path)
);
}

return LazyCollection::make(function () use ($path) {
return new LazyCollection(function () use ($path) {
$file = new SplFileObject($path);

$file->setFlags(SplFileObject::DROP_NEW_LINE);
Expand Down

0 comments on commit 1472088

Please sign in to comment.