Adding documentation for static analysis tools
Hey,
Has any thought been given to supporting phpstan/psalm generics e.g.
class Foo
{
/**
* @return Promise<MyDomainThing>
*/
public function wait(): Promise { // ... }
}
Otherewise, what's the best way to document a Promise that's compatible with SA tools?
Psalm has some stubs for Amp: https://github.com/vimeo/psalm/blob/master/src/Psalm/Internal/Stubs/Amp.php
See https://github.com/amphp/amp/pull/301
But yeah we might want to apply the rest of the Psalm stubs too.
It's been 2 years, but just to be clear you're trying to achieve something like this right? (using psalm)

Psalm does it out of the box for me in VSCode, though you may want to disable autocompletion for Intelephense if you're using that plugin, it seems to conflict with psalm when it comes to PHPDocs ontop of duplicating some other autocompletions aswell.
Here's my psalm.xml, I hope it helps:
<?xml version="1.0"?>
<psalm
errorLevel="7"
resolveFromConfigFile="true"
ensureArrayStringOffsetsExist="true"
ensureArrayIntOffsetsExist="true"
checkForThrowsInGlobalScope="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src" />
<directory name="tests" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
</psalm>
ps: I can't seem to get it working in PHPStorm (with psalm) unfortunately.