Versions:
- ide-helper Version: v3.7.0
- Laravel Version: v12.58.0
- PHP Version: 8.4.18 (project constraint:
^8.2 || ^8.3 || ^8.4)
Description:
After running php artisan ide-helper:generate, the generated global Eloquent class in _ide_helper.php declares whereIn() with correct PHP default values:
public static function whereIn($column, $values, $boolean = 'and', $not = false)
However, the PHPDoc block above it lists four separate @param tags ($column, $values, $boolean, $not) with no indication that $boolean and $not are optional. Static analyzers that infer required arity from @param count (e.g. Intelephense P1005) then report that four arguments are required.
Models that use @mixin IdeHelper* (from ide-helper:models), which includes @mixin \Eloquent, resolve hovers and diagnostics to App\Models\Foo::whereIn. A valid call such as:
SomeModel::query()->whereIn('id', [1, 2]);
is flagged as not enough arguments (expected 4, found 2) even though runtime and the generated PHP signature only require two.
Runtime behavior matches Laravel’s query builder; the issue is documentation mismatch between PHPDoc and the actual optional parameters.
IDE: VS Code / Cursor with Intelephense 1.18.2 (same behavior is analyzer-dependent, not PHP-runtime).
Steps To Reproduce:
- Install
barryvdh/laravel-ide-helper and run php artisan ide-helper:generate so _ide_helper.php exists.
- Run
php artisan ide-helper:models -M (or equivalent) so a model gets @mixin IdeHelper* with @mixin \Eloquent in the generated _ide_helper_models.php.
- In application code, open a file and add:
\App\Models\YourModel::query()->whereIn('id', [1]);
- Open
_ide_helper.php and locate the generated Eloquent::whereIn method: compare the four @param lines in the docblock to the method signature with default values on $boolean and $not.
- In the editor with Intelephense enabled, observe P1005 (or equivalent) on the
whereIn call, or hover whereIn and see four parameters presented as required.
Expected: PHPDoc matches optional parameters (or omits optional @param lines) so two-argument whereIn calls are not reported as errors.
Actual: Analyzer treats four @param entries as four required parameters.
Versions:
^8.2 || ^8.3 || ^8.4)Description:
After running
php artisan ide-helper:generate, the generated globalEloquentclass in_ide_helper.phpdeclareswhereIn()with correct PHP default values:However, the PHPDoc block above it lists four separate
@paramtags ($column,$values,$boolean,$not) with no indication that$booleanand$notare optional. Static analyzers that infer required arity from@paramcount (e.g. Intelephense P1005) then report that four arguments are required.Models that use
@mixin IdeHelper*(fromide-helper:models), which includes@mixin \Eloquent, resolve hovers and diagnostics toApp\Models\Foo::whereIn. A valid call such as:is flagged as not enough arguments (expected 4, found 2) even though runtime and the generated PHP signature only require two.
Runtime behavior matches Laravel’s query builder; the issue is documentation mismatch between PHPDoc and the actual optional parameters.
IDE: VS Code / Cursor with Intelephense 1.18.2 (same behavior is analyzer-dependent, not PHP-runtime).
Steps To Reproduce:
barryvdh/laravel-ide-helperand runphp artisan ide-helper:generateso_ide_helper.phpexists.php artisan ide-helper:models -M(or equivalent) so a model gets@mixin IdeHelper*with@mixin \Eloquentin the generated_ide_helper_models.php._ide_helper.phpand locate the generatedEloquent::whereInmethod: compare the four@paramlines in the docblock to the method signature with default values on$booleanand$not.whereIncall, or hoverwhereInand see four parameters presented as required.Expected: PHPDoc matches optional parameters (or omits optional
@paramlines) so two-argumentwhereIncalls are not reported as errors.Actual: Analyzer treats four
@paramentries as four required parameters.