-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined method 'onEachSide'. intelephense(P1013) #2912
Comments
I think the problem is that You could assign the result on /** @var \Illuminate\Pagination\AbstractPaginator $paginator */
$paginator = $query->paginate(10);
//or alternatively
if ($paginator instanceof \Illuminate\Pagination\AbstractPaginator) {
$projects = $paginator->onEachSide(1);
} Or you could fool the extension by adding the intelephense_helper.php namespace Illuminate\Contracts\Pagination;
interface LengthAwarePaginator {
function onEachSide($param) {};
} |
…ngthAwarePaginator` Return types of all the subsequent calls are returning this, which in turn implements `\Illuminate\Contracts\Pagination\LengthAwarePaginator` Related to bmewburn/vscode-intelephense#2912. Which I in turn had issues with locally where calling methods to the returned data from `->paginage()` did not auto complete. Hope this is possible to backport to 11.x too if this is a change that is okay.
…ngthAwarePaginator` (#54826) Return types of all the subsequent calls are returning this, which in turn implements `\Illuminate\Contracts\Pagination\LengthAwarePaginator` Related to bmewburn/vscode-intelephense#2912. Which I in turn had issues with locally where calling methods to the returned data from `->paginage()` did not auto complete. Hope this is possible to backport to 11.x too if this is a change that is okay.
…ngthAwarePaginator` (#54826) Return types of all the subsequent calls are returning this, which in turn implements `\Illuminate\Contracts\Pagination\LengthAwarePaginator` Related to bmewburn/vscode-intelephense#2912. Which I in turn had issues with locally where calling methods to the returned data from `->paginage()` did not auto complete. Hope this is possible to backport to 11.x too if this is a change that is okay.
…ngthAwarePaginator` (laravel#54826) Return types of all the subsequent calls are returning this, which in turn implements `\Illuminate\Contracts\Pagination\LengthAwarePaginator` Related to bmewburn/vscode-intelephense#2912. Which I in turn had issues with locally where calling methods to the returned data from `->paginage()` did not auto complete. Hope this is possible to backport to 11.x too if this is a change that is okay.
…ngthAwarePaginator` (#54826) (#54917) Return types of all the subsequent calls are returning this, which in turn implements `\Illuminate\Contracts\Pagination\LengthAwarePaginator` Related to bmewburn/vscode-intelephense#2912. Which I in turn had issues with locally where calling methods to the returned data from `->paginage()` did not auto complete. Hope this is possible to backport to 11.x too if this is a change that is okay.
…ngthAwarePaginator` (#54826) (#54917) Return types of all the subsequent calls are returning this, which in turn implements `\Illuminate\Contracts\Pagination\LengthAwarePaginator` Related to bmewburn/vscode-intelephense#2912. Which I in turn had issues with locally where calling methods to the returned data from `->paginage()` did not auto complete. Hope this is possible to backport to 11.x too if this is a change that is okay.
Describe the bug
Intelephense says undefined method 'onEachSide' for the Illuminate\Database\Eloquent\Collection::onEachSide method.
To Reproduce
$projects = Project::query()->paginate(10)->onEachSide(1);
Expected behavior
There should be no Intelephense error as this is a defined method and the code works just fine but it displays as if it were wrong in VScode.
Screenshots

Platform and version
VSCode and PHP Intelephense v1.10.4
The text was updated successfully, but these errors were encountered: