laravel-ide-helper icon indicating copy to clipboard operation
laravel-ide-helper copied to clipboard

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

Open mylemans opened this issue 2 years ago • 0 comments

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 avatar Aug 23 '22 08:08 mylemans