Skip to content
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

[11.x] feat: add generics to tap() helper #51881

Merged
merged 1 commit into from
Jun 24, 2024
Merged

Conversation

calebdw
Copy link
Contributor

@calebdw calebdw commented Jun 21, 2024

Hello!

This PR adds generics to the tap() helper so it properly knows the correct return type:

        // returned mixed, now returns RepositoryFake
        return tap(new RepositoryFake($feed), function ($fake) {
            static::swap($fake);
        });

I also went ahead and made some of the other tap methods more specific.

Thanks!

@driesvints driesvints requested a review from nunomaduro June 24, 2024 14:17
@taylorotwell taylorotwell merged commit 7100359 into laravel:11.x Jun 24, 2024
28 checks passed
@calebdw
Copy link
Contributor Author

calebdw commented Jun 24, 2024

Thanks @taylorotwell!

@calebdw calebdw deleted the tap branch June 24, 2024 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants