laravel-idea/plugin

[Bug]: Return type in docBlock prevent facade methods to be recognized

Opened this issue · 0 comments

Bug description

Hello,

if you have a docBlock (for phpstan) with generics like

    /**
     * @return array<string, array<string, string>>
     */
    public function testmethod(): array

it prevents the helper code to add this method to the facade class.

Plugin version

8.2.1.241

Operating system

Windows

Steps to reproduce

  1. Make a class for a Facade with a message and a docBlock
class TestService {
  /**
  * @return array<string, array<string, string>>
  */
  public function testMethod(): array
  {
     return ['foo' => ['bar' => 'lose']];
  }
}
  1. Add a Facade class to the project
/**
 * @see \App\Services\TestService
 */
class TestService extends Facade
{
    protected static function getFacadeAccessor(): string
    {
        return 'test-service';
    }
}
  1. Add Facade to AppServiceProvider register method
class AppServiceProvider extends ServiceProvider
{
  [...]
  public function register(): void
  {
    [...]
   $this->app->bind('test-service', fn () => new \App\Serivces\TestService());
  }
  1. Generate the Helper Code with Laravel Idea
  2. Try to add the method anywhere with the Facade and it won't be shown for auto complete nor will it be clickable after manuel typing it.

The generated _ide_helper_facades.php includes:

/** @noinspection all */

namespace App\Facades {
    /**
     * @see \App\Services\TestService::testMethod
     * @method static \string[][] testMethod()
     */
    class TestService {}
}

Relevant log output

No response