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

laravel-debugbar package breaks Collection constructor parameter awareness (_ide_helper.php) #1368

Open
mylemans opened this issue Aug 23, 2022 · 1 comment
Labels

Comments

@mylemans
Copy link

Versions:

  • ide-helper Version: 2.12.3
  • Laravel Version: 9.25.1
  • PHP Version: 8.1.8
  • PhpStorm 2022.2.1

Description:

Generated _ide_helper.php code for Collection, when using laravel-debugbar package, breaks constructor awareness.

The following gets generated, and as a result, PhpStorm no longer sees that the new Collection(...) constructor accepts a parameter.
If I remove this whole section from _ide_helper.php, PhpStorm 'sees' the constructor again.

        /**
   *
   *
   * @template TKey of array-key
   * @template TValue
   * @implements \ArrayAccess<TKey, TValue>
   * @implements \Illuminate\Support\Enumerable<TKey, TValue>
   */
      class Collection {
                  /**
       *
       *
       * @see \Barryvdh\Debugbar\ServiceProvider::register()
       * @static
       */
      public static function debug()
      {
                      return \Illuminate\Support\Collection::debug();
      }

  }

image
image

Steps To Reproduce:

Generate _ide_helper.php with the laravel-debugbar composer package installed.

@mylemans mylemans added the bug label Aug 23, 2022
@mylemans mylemans changed the title laravel-debugbar package breaks constructor parameter awareness (_ide_helper.php) laravel-debugbar package breaks Collection constructor parameter awareness (_ide_helper.php) Aug 23, 2022
@spawnia
Copy link
Contributor

spawnia commented Feb 10, 2025

I think this issue is basically the same as #1585, and it is a bit more general. The presence of any macros on Collection will cause it to be included in _ide_helper.php, but missing a constructor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants