Closed BernhardBaumrock closed 3 years ago
If you rewrite the meta file in the newer phpstorm format it will be understood.
Duplicate of #1711
Closing this one as it can be solved with phpstorm meta. Looking at changing the minimal type reduction that's probably happening here in #1711
In advance: Thx for your help and the awesome extension!!
I'm using the ProcessWire CMS in my everyday work. ProcessWire has a base class Wire that almost every other class extends. The Wire base class has a wire() method that can return several objects:
Here is the definition: https://github.com/processwire/processwire/blob/d8945198f4a6a60dab23bd0462e8a6285369dcb9/wire/core/Wire.php#L1710
The Problem
$this->wire()->...
does not suggest anything useful:This is how it should look like:
Calling $this->wire (using the wire property instead of the wire method) works because of a different phpdoc: https://github.com/processwire/processwire/blob/d8945198f4a6a60dab23bd0462e8a6285369dcb9/wire/core/Wire.php#L61
But I'd really like my Intelephense to understand wire() calls, because that's the way it is used everywhere in the core of ProcessWire.
PHPStorm does understand what's going on because of this meta file: https://github.com/processwire/processwire/blob/master/wire/core/.phpstorm.meta.php
Any ideas what would be the best direction to tackle this problem? I wonder if Intelephense should return all possible methods that are part of all possible return types of the method? Or maybe just return the first one listed as default?
Thx again!