Hi

PHP tool gives this waring: Argument '2' passed to whereBetween() is expected to be of type Illuminate\Database\Query\iterable, array given

on this:

return UserDoc::whereUserId($this->id)->whereBetween('created_at', [$fromDate, $toDate])->get();

definition of whereBetween is:

/**
     * Add a where between statement to the query.
     *
     * @param  \Illuminate\Contracts\Database\Query\Expression|string  $column
     * @param  iterable  $values
     * @param  string  $boolean
     * @param  bool  $not
     * @return $this
     */

rabol This may be coming from an older cache data.

Please run VSCode command Clear /vendor/ cache ...

    6 days later

    Same result, sorry

      4 days later

      Is there a command that can clear all PHPTool's cache ?

        7 days later

        ok.. done that a few times, and I still get the same result, sorry

          So it is still reporting expected to be of type Illuminate\Database\Query\iterable, array given?

          If you Ctrl+Click on whereBetween, where does it go?

            @rabol I see!

            _ide_helper.php is wrong. The following is incorrectly generated (by the ide-helper):

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

            Such a class does not exist, and we report it as unknown.

              long story short, it looks like a bug in ide-helper, and I'm not sure what to do with it :) I'll consider implementing a special case for this

                Write a Reply...