mesour-intellij-plugins / latte-pro-issues

2 stars 0 forks source link

Support potentially polymorphic calls #117

Open mabar opened 1 year ago

mabar commented 1 year ago

Is your feature request related to a problem? Please describe.

In PHP I can click through from method definition to its usage and from usage to definition even if the method does not exist on the current class but only on a child class. Technically wrong but useful when dealing with legacy code or generics.

class Form {}

interface Control {}

abstract class BaseControl implements Control {
    public const Form = 'form';
    public Form $form;
    public function getForm(): Form
    {
        return new Form();
    }
}

class AnotherControl implements Control {}

function smth(Control $control) {
    echo $control::Form;
    echo $control->form;
    echo $control->getForm();
}

This also applies to constants and properties

Describe the solution you'd like

Same as in PHP: