这是indexloc提供的服务,不要输入任何密码
Skip to content

Installing generates false positive error with \assert() second argument #15

@asgraf

Description

@asgraf
\assert($variable instanceof SomeClass);

After installing this plugin code above will start displaying following error:

Required parameter '$description' missing

This is simply just not true.
Code above is completely valid, and second argument of assert function is completely optional
PHP documentation states:

if no description is provided, a default description equal to the source code for the invocation of assert() is provided. 

Source:
https://www.php.net/manual/en/function.assert.php#refsect1-function.assert-parameters

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions