Skip to content

Imprecise composer autoload_files #4751

Discussion options

You must be logged in to vote

Hi, if I understand the problem correctly, it's that the function is defined as:

    function factory()
    {
        $factory = app(EloquentFactory::class);

        $arguments = func_get_args();

        if (isset($arguments[1]) && is_string($arguments[1])) {
            return $factory->of($arguments[0], $arguments[1])->times($arguments[2] ?? null);
        } elseif (isset($arguments[1])) {
            return $factory->of($arguments[0])->times($arguments[1]);
        }

        return $factory->of($arguments[0]);
    }

But PHPStan complains with: Function factory invoked with 1 parameter, 0 required

Three points:

  1. Stub files aren't meant to override this as this isn't a PHPDoc problem,…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@bytestream
Comment options

@ondrejmirtes
Comment options

@bytestream
Comment options

Answer selected by ondrejmirtes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Support
Labels
None yet
2 participants