Skip to content

Commit

Permalink
Fixed bug that the return type of Collection::mapInto() is invalid …
Browse files Browse the repository at this point in the history
…sometimes. (#6796)
  • Loading branch information
limingxinleo authored May 24, 2024
1 parent efd2b51 commit e98bdeb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Enumerable.php
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ public function flatMap(callable $callback): static;
* @param class-string<TMapIntoValue> $class
* @return static<TKey, TMapIntoValue>
*/
public function mapInto(mixed $class): static;
public function mapInto(mixed $class): self|static;

/**
* Merge the collection with the given items.
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/EnumeratesValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ public function flatMap(callable $callback): static
* @param class-string<TMapIntoValue> $class
* @return static<TKey, TMapIntoValue>
*/
public function mapInto(mixed $class): static
public function mapInto(mixed $class): self|static
{
if (is_subclass_of($class, BackedEnum::class)) {
return $this->map(fn ($value, $key) => $class::from($value));
Expand Down

0 comments on commit e98bdeb

Please sign in to comment.