pbyrne84 / DynamicReturnTypePlugin

135 stars 7 forks source link

Call static method not work #74

Closed yapro closed 6 years ago

yapro commented 6 years ago

I have problem with autocomplete when I call static method of MyClass

class MyClass
{
    public function myFunction()
    {

    }
}
function get($class)
{
    return 'my implementation';
}
get('\MyClass')->myFunction();// it work

class MyDIContainer
{
    public static function get($class)
    {
        return 'my implementation';
    }
}
MyDIContainer::get('\MyClass')->myFunction();// it not work

Content of file dynamicReturnTypeMeta.json

{
  "methodCalls": [
    {
      "class": "\\MyDIContainer",
      "method": "get",
      "position": 0,
      "fileReturnTypeReplacementCall": ["JavaScriptReplacementCallback.js", "replaceWithJavaScriptAliasing"]
    }
  ],
  "functionCalls": [
    {
      "function": "\\get",
      "position": 0
    }
  ]
}

I also tried not to use

"fileReturnTypeReplacementCall": ["JavaScriptReplacementCallback.js", "replaceWithJavaScriptAliasing"]

but it not helped my.

What I do wrong?

yapro commented 6 years ago

Sorry, it work but not in all my repositories. Even without:

"fileReturnTypeReplacementCall": ["JavaScriptReplacementCallback.js", "replaceWithJavaScriptAliasing"]