Vscode-intelephense: Expected type 'Closure'. Found 'callable|#Function#eb14f754'

Created on 21 Feb 2019  路  6Comments  路  Source: bmewburn/vscode-intelephense

Hi,

I'm getting the error _"Expected type 'Closure'. Found 'callable|#Function#eb14f754'"_ with this simple code:

<?php

function test(\Closure $closure) {

}

test(function() {

});

Here is the error message:

{
    "resource": "/d:/temp/test.php",
    "owner": "_generated_diagnostic_collection_name_#1",
    "code": "10006",
    "severity": 8,
    "message": "Expected type 'Closure'. Found 'callable|#Function#eb14f754'.",
    "source": "intelephense",
    "startLineNumber": 7,
    "startColumn": 6,
    "endLineNumber": 9,
    "endColumn": 2
}

The version used is 1.0.1 (2019-02-20).

As far as I can understand the code describes the only way to create a Closure ( https://secure.php.net/manual/en/functions.anonymous.php ) so it shouldn't be highlighted as an type error.

Thanks!

resolved in 1.0.3

Most helpful comment

Yep, getting a lot of all kind of errors with type hinting with v1.

A workaround is to downgrade to v0.8.8. It can be done from vscode extension manager.

All 6 comments

Yep, getting a lot of all kind of errors with type hinting with v1.

A workaround is to downgrade to v0.8.8. It can be done from vscode extension manager.

Same here.
imagen

@apihlaja , is it possible to disable some hints? I wouldn't like to downgrade because I think this version is great despite these bugs.

I've found a "workaround" but I don't like it. I have a lot of callables in my projects.
imagen

Also experiencing the same issue, when is 1.1 likely to be released?

Was this page helpful?
0 / 5 - 0 ratings