ide-helper icon indicating copy to clipboard operation
ide-helper copied to clipboard

No TypeHinting

Open Kapsonfire opened this issue 6 years ago • 2 comments

The docs are missing typehints in phpdoc

Like in Coroutine\Mysql -> prepare()

/** * @return \Swoole\Coroutine\MySQL\Statement */ public function prepare($query, $timeout = null) { }

Kapsonfire avatar Oct 26 '19 21:10 Kapsonfire

The stubs are created by reverse-engineering the Swoole extensions directly; thus there is no documentation included, and type hinting is missing in many places. The Swoole team has tried its best to keep the stubs up to date, and we do want to add inline documentation and type hinting in the future; however, due to limited resources we don't know when it will be ready.

Here are some alternatives you can consider:

Thanks for reporting it. I have included above information on the repository page (in file README.md), and will leave this issue open (so that other people won't report the same thing if they see it).

deminy avatar Oct 31 '19 05:10 deminy

How can I help. Is it possible to create a static php file which includes the typehint data like $typehints = [ 'Coroutine\Mysql::prepare' => '\Swoole\Coroutine\MySQL\Statement' ];

Kapsonfire avatar Oct 31 '19 06:10 Kapsonfire

Typehints have been added to most classes and functions, and we are keep updating/improving the stubs.

Thanks for submitting the issue and providing suggestions.

Closing the issue.

deminy avatar Sep 16 '22 22:09 deminy