php-parallel-lint/PHP-Parallel-Lint

Unexpected end of file with anonymous function

Pablo-Lilao opened this issue · 2 comments

Describe the bug
When parallel-lint analyses a php file with an anonymous function it throws an error.

To reproduce
test.zip

Expected behavior
Parallel-lint analyses the source file without throwing any error.

Screenshots
Parallel-lint_error

jrfnl commented

@Pablo-Lilao That's because your code has a parse error.

Your code:

function ()
{
    $a= 10;
}

Should be fixed to:

function ()
{
    $a= 10;
};

Take note of the semi-colon after the curly close brace of the closure. That was missing from your code sample and is the cause of the parse error.

Indeed, that was the issue.