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

Fix callable in anticipate #8

Merged
merged 1 commit into from
Mar 21, 2022
Merged

Conversation

bastien-phi
Copy link
Member

In some cases, calls to anticipate fails with Method Some\Class::SomeMethod does not exist.
for exemple:

Method Illuminate\Auth\SessionGuard::Management does not exist.

This can happen when the anticipation array contains 2 elements and the first one is an exiting class :

 $this->anticipate('What is the Application ?', ['Auth', 'Management']);

['Auth', 'Management'] is considered a valid callable and Symfony component tries to call it.

The solution here is to wrap this array in a closure :

 $this->anticipate('What is the Application ?', fn() => ['Auth', 'Management']);

@bastien-phi bastien-phi merged commit 1c1b18a into main Mar 21, 2022
@bastien-phi bastien-phi deleted the fix_callable_in_autocomplete branch March 21, 2022 13:09
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.

None yet

1 participant