[Bug]: Exception 'x' is never thrown in the corresponding 'try' block when using Facades
Bug description
When I generate the helper code for my custom facade's, the @throws are not being added to _ide_helper_facades.php which will result in the following warning when I add a try/catch block in my code.
Besides that, it's not hinting that the method could throw an exception which other code does and the exception is grayed out hinting that it's unused. Other code hints are provided such as the params and return.
Here is what my code looks like:
app\Facades\Example.php
<?php
namespace App\Facades;
use Illuminate\Support\Facades\Facade;
/**
* @see \App\Services\Example
*/
class Example extends Facade
{
protected static function getFacadeAccessor()
{
return 'example';
}
}
app\Services\Example.php
<?php
namespace App\Services;
use App\Exceptions\TestException;
use Illuminate\Support\Collection;
class Example
{
/**
* Test
*
* @param array $test
*
* @return \Illuminate\Support\Collection
* @throws \App\Exceptions\TestException
*/
public function test(array $test): Collection
{
throw new TestException('Test Error');
}
}
vendor/_laravel_idea/_ide_helper_facades.php (snippet)
/**
* @see \App\Services\Example::test
* @method static \Illuminate\Support\Collection test(array $test)
*/
class Example {}
Plugin version
8.1.2.232
Operating system
MacOS
Steps to reproduce
No response
Relevant log output
No response
I have the same problem on windows.
A function has a @throw doc block and the facade doesn't mention any of those.
Laravel Idea 10 supports Facades natively, so this issue should disappear. Please update and try.