A
A
artsiom19762019-10-07 17:01:58
phpstorm
artsiom1976, 2019-10-07 17:01:58

How to set phpdoc for method not found?

a piece of the router: the controller has already been called, we call the controller method and connect the view

if (method_exists($controller, $action)) {
    $cObj->$action();
    $cObj->getView(); // PhpStorm ругается, что метод не найден
} else {
    echo "<code>Метод {$controller}::{$action} не найден</code>";
}

the fact is that everything works, the getView () method is called, but the getView () method itself is in the base abstract controller, from which the called controller extends, so the IDE shines like an unknown there is
no experience in documenting code in the IDE, trying to figure it out phpdoc on my own - so-so :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2019-10-07
@artsiom1976

if (method_exists($controller, $action)) {
    /** @var MyClass $cObj */
    $cObj->$action();
    $cObj->getView(); // PhpStorm ругается, что метод не найден
} else {
    echo "<code>Метод {$controller}::{$action} не найден</code>";
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question