Skip to content

Conversation

@Jaspur
Copy link
Contributor

@Jaspur Jaspur commented Dec 10, 2025

This PR prevents ide-helper from calling Facade::fake() on facades whose fake() method requires parameters.
Laravel Socialite expects a required $driver argument, causing an ArgumentCountError during php artisan ide-helper:generate.

By checking the number of required parameters via reflection and skipping such facades, the generator behaves correctly without affecting other facades that support parameterless faking.

… error)

The ide-helper attempted to invoke Facade::fake() unconditionally, which
breaks when a facade (such as Laravel Socialite) requires a mandatory
parameter in its fake() method signature. This resulted in an
ArgumentCountError during `php artisan ide-helper:generate`.

This patch adds a ReflectionMethod check and skips calling fake() when
required parameters are present, ensuring compatibility with Socialite
and preserving expected behavior for facades that support parameterless
faking.
@barryvdh
Copy link
Owner

I think the error was resolved in #1745 but I guess this is the cleaner way.

@barryvdh barryvdh merged commit 2ac73f2 into barryvdh:master Dec 10, 2025
25 checks passed
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