Populate Controller with objects/fields defined in view


I want to implement a PhpStorm plugin that helps with PHP Classes with properties that are defined in the corresponding view (xml).
The properties are added during runtime by the framework based on an xml view:

Example View:

<com:TButton ID="bt1" Text="click me" OnClick="action" />

Example Controller:

class Controller extends TPage {

  public function action(...) {
        $this->bt1->Text = "Button was clicked";
        //$this->bt1 is not defined in this class, but available during runtime because its added/resolved by the framework

It would be good if PhpStorm would provide Completion, References, and Inspection information based on the fields that are defined in the view xml.
What needs to be done for this? Do I need to add a reference contributor for the view? Will this also add Completion and fix the Inspection?


1 comment
Comment actions Permalink

There is no suitable extension point to add "fake" tb1 property to class at the moment.

The only way you can make this resolve/complete is to generate @property annotaions.

Feel free to submit a feature request to https://youtrack.jetbrains.com/newIssue?project=WI


Please sign in to leave a comment.