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

Add getUser to Auth when it not found

Open dmitrach opened this issue 3 years ago • 0 comments

Versions:

  • ide-helper Version: v2.10.0
  • Laravel Version: v8.22.1
  • PHP Version: PHP 7.3.28-1+ubuntu20.04.1+deb.sury.org+1 (cli)

Description:

I get the exception when Auth::getUser() is used: Method Illuminate\Auth\RequestGuard::getUser does not exist.

use Auth; // uses the generated description from _ide_helper.php

// ...

Auth::user(); // exists
Auth::getUser(); // It add this method. But it works only when no API requires.
\Illuminate\Support\Facades\Auth::user(); // It exists and shows from the DocBlock of the facade.
\Illuminate\Support\Facades\Auth::getUser(); // it doesn't exist in the description, but adds to generated `Auth`.

It is problem that Auth contains getUser that can be described in \Illuminate\Support\Facades\Auth.

dmitrach avatar May 19 '21 07:05 dmitrach