K
K
Kripto772019-03-03 21:22:27
phpstorm
Kripto77, 2019-03-03 21:22:27

Why doesn't PhpStorm recognize method call chains?

Strangely, PhpStorm does not recognize methods in the call chain other than the first one and shows that the method does not exist.
Prompt how to teach to recognize or eliminate this problem.
On the screen is an example. Storm version 2018.1.4
5c7c1b437454d954942988.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arman, 2019-03-03
@Kripto77

/**
 * @return self
 */
protected function chainMethod2(): self
{

}

up: in general, you need to prompt the IDE when things that are not obvious happen. in this case, the setReplaceName() method should return return $this, if there is such a method, if the method is magic, then you can add in the comments to the class:
* @method self setReplaceName()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question