Skip to content
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

Expected type 'iterable'. Found 'Illuminate\Database\Query\iterable'. #1555

Open
kejedi opened this issue Jun 7, 2024 · 3 comments
Open
Labels

Comments

@kejedi
Copy link

kejedi commented Jun 7, 2024

Versions:

  • ide-helper Version: 3
  • Laravel Version: 11
  • PHP Version: 8

Description:

I am getting the following error inside of the ide helper file in vscode:

Expected type 'iterable'. Found 'Illuminate\Database\Query\iterable'.

If I change this line:

@param \Illuminate\Database\Query\iterable $values

To this:

@param iterable $values

The error disappears.

This happens in multiple places inside of the ide helper file btw.

@kejedi kejedi added the bug label Jun 7, 2024
@mfn
Copy link
Collaborator

mfn commented Jun 8, 2024

How does your model look like? Please post more details.

@kejedi
Copy link
Author

kejedi commented Jun 8, 2024

Heres the full code block in the ide helper file:

             * Add a where between statement to the query.
             *
             * @param \Illuminate\Contracts\Database\Query\Expression|string $column
             * @param \Illuminate\Database\Query\iterable $values
             * @param string $boolean
             * @param bool $not
             * @return \Illuminate\Database\Query\Builder 
             * @static 
             */            public static function whereBetween($column, $values, $boolean = 'and', $not = false)
            {
                                /** @var \Illuminate\Database\Query\Builder $instance */
                                return $instance->whereBetween($column, $values, $boolean, $not);
            }

The whereBetween method accepts a generic iterable type in the parameters. Making the changes I previously mentioned resolves the issue.

@mfn
Copy link
Collaborator

mfn commented Jun 10, 2024

Heres the full code block in the ide helper file:

No, I asked for the model please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants