Skip to content

Conversation

@WentTheFox
Copy link
Contributor

@WentTheFox WentTheFox commented Dec 9, 2025

Summary

The helper generation breaks when the Laravel\Socialite\Socialite facade's fake method (introduced in laravel/socialite#756) is being called by the IDE helper, because the method has a required argument. In PHP 8.5 this causes an ArgumentCountError as seen below:

> Illuminate\Foundation\ComposerScripts::postUpdate
> @php artisan ide-helper:generate

   ArgumentCountError 

  Too few arguments to function Laravel\Socialite\Socialite::fake(), 0 passed in vendor/barryvdh/laravel-ide-helper/src/Alias.php on line 254 and at least 1 expected

  at vendor/laravel/socialite/src/Socialite.php:39
     35▕      * @param  string  $driver
     36▕      * @param  \Laravel\Socialite\Contracts\User|\Closure|array|null  $user
     37▕      * @return \Laravel\Socialite\Testing\SocialiteFake
     38▕      */
  ➜  39▕     public static function fake(string $driver, $user = null)
     40▕     {
     41▕         $root = static::getFacadeRoot();
     42▕ 
     43▕         if ($root instanceof SocialiteFake) {

      +18 vendor frames 

  19  artisan:35
      Illuminate\Foundation\Console\Kernel::handle()

Script @php artisan ide-helper:generate handling the post-update-cmd event returned with error code 1
ArgumentCountError screenshot

The goal of this change is to fully ignore the error so the ide-helper:generate command can complete without crashing, as it seems the missing catch block causes the error to be thrown despite being wrapped in try.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • Existing tests have been adapted and/or new tests have been added
  • Update the README.md
  • Code style has been fixed via composer fix-style

@Orrison
Copy link

Orrison commented Dec 9, 2025

Seeing this issue as well

@FallenKnight85
Copy link

Experiencing this issue as well

@barryvdh barryvdh merged commit 12a0d7d into barryvdh:master Dec 10, 2025
8 of 25 checks passed
@WentTheFox
Copy link
Contributor Author

WentTheFox commented Dec 10, 2025

@barryvdh I think the tests failed due to the

return ’’;

in the MockFacade class, that might have to be replaced with an actual class string. I did not see that earlier since the pipelines were waiting for approval.

@barryvdh
Copy link
Owner

Yes fixed that already; c95825a

@barryvdh
Copy link
Owner

This is tagged, so should be good now.

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.

4 participants