plugin
plugin copied to clipboard
[Bug]: Mixins not recognized (properly) for hammerstonedev/fast-paginate
Bug description
When using the fastPaginate() or simpleFastPaginate() method from the hammerstonedev/fast-paginate package, Laravel Idea won't recognize its methods under the Builder class, and recognizes - but incorrectly, though - for Relations.
I'm not sure if this is fixable on the plugin's end, or it's completely a package related issue. If the latter, is there any way to fix this behavior, without creating my own IDE helper classes with @method PHPDocs?
Plugin version
7.4.3.232
Operating system
Linux
Steps to reproduce
-
composer require hammerstone/fast-paginate:^1.0 - Create a Controller
- Run
User::query()->fastPaginate()orUser::query()->simpleFastPaginate()- It runs perfectly fine, but PHPStorm says
Method 'fastPaginate' not found in \Illuminate\Database\Eloquent\Builder|\LaravelIdea\Helper\App\Models\_IH_User_QB
- It runs perfectly fine, but PHPStorm says
- Run
User::first()->posts()->fastPaginate();orUser::first()->posts()->simpleFastPaginate();- It runs perfectly fine, however, Laravel Idea thinks it'll return
HigherOrderTapProxy|mixed, which is not right, because it'll returnIlluminate\Pagination\LengthAwarePaginator
- It runs perfectly fine, however, Laravel Idea thinks it'll return
Relevant log output
// _ide_helper_macro.php
namespace Illuminate\Database\Eloquent\Relations {
use Illuminate\Support\HigherOrderTapProxy;
/**
* @method HigherOrderTapProxy|mixed fastPaginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null)
* @method HigherOrderTapProxy|mixed simpleFastPaginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null)
*/
class Relation {}
}