SOF3 / await-generator

Write code in async/await style in PHP using generators.
https://sof3.github.io/await-generator/master/
Apache License 2.0
123 stars 15 forks source link

Parse Generator<mixed, mixed, mixed, T> docs and validate the type of return value #117

Closed Endermanbugzjfc closed 2 years ago

Endermanbugzjfc commented 2 years ago

A little enhancement to help to debug and prevent unexpected behaviour. Although PHPStorm can already warn users.

SOF3 commented 2 years ago

I don't understand what you mean. Who parses this doc? When does it parse this doc?

Endermanbugzjfc commented 2 years ago

I don't understand what you mean. Who parses this doc? When does it parse this doc?

Await-generator should parse the doc after running a generator and validate the return value's type. But I think this is not possible because the PHPDoc of a function is not linked with a generator.

SOF3 commented 2 years ago

I don't understand what you mean. Who parses this doc? When does it parse this doc?

Await-generator should parse the doc after running a generator and validate the return value's type. But I think this is not possible because the PHPDoc of a function is not linked with a generator.

no more runtime checks please. this should be done in static analysis. don't waste runtime performance like PHP did.

also await-generator doesn't even have your generator if you use yield from.