Haehnchen / idea-php-symfony2-plugin

IntelliJ IDEA / PhpStorm Symfony Plugin
https://plugins.jetbrains.com/plugin/7219
MIT License
911 stars 137 forks source link

[Form] Add TypeProvider for Form::get #469

Open King2500 opened 9 years ago

King2500 commented 9 years ago

It would be cool, if you could implement a TypeProvider for Form::get('child') method result.

PhpStorm can't understand the correct result, because of the generic FormInterface:

Method 'isClicked' not found

You already "detect" the Form types when autocompleting: (though FormInterface and FormTypes are not the same here)

Form::get auto-completion

In this case its return type is Symfony\Component\Form\SubmitButton.

Known types from Form component (implementing FormInterface):

All other form fields are of type:

I think this could work similar to your get('service') TypeProvider?

Haehnchen commented 9 years ago

get was blocked by service container type provider. this api limit was hopefully fixed in phpstorm8. we will see :)