Haehnchen / idea-php-toolbox

Collections of tools and improvements to make PhpStorm a little bit better
http://phpstorm.espend.de/php-toolbox
MIT License
159 stars 20 forks source link

TypeProvider for classes got via return contributor #55

Open King2500 opened 8 years ago

King2500 commented 8 years ago

I couldn't get TypeProvider working on getExtension:

$this->get('twig')->getExtension('core')->{caret}

It only shows the standard Twig_ExtensionInterface methods, but not the ones got from the Twig_Extension_Core (or any other/user) extension, which is provided by name.

{
    "registrar": [
        {
            "provider": "twig.extensions",
            "language": "php",
            "signatures": [
                {
                    "class": "Twig_Environment",
                    "method": "getExtension",
                    "type": "type"
                }
            ]
        }
    ],
    "providers": [
        {
            "name": "twig.extensions",
            "source": {
                "contributor": "return",
                "parameter": "Twig_ExtensionInterface:getName"
            }
        }
    ]
}
King2500 commented 8 years ago

For reference: http://twig.sensiolabs.org/api/master/Twig_ExtensionInterface.html http://twig.sensiolabs.org/api/master/Twig_Extension_Core.html