Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSupport for callable definitions #83
Comments
|
the signature should also support return types, e.g. /**
* Summary.
*
* @param callable(Throwable|Exception $error):MyReturnType $callback
* Callback executed upon uncaught errors.
*/ |
|
This will complicate the parser, as spaces can't be used to separate the arguments anymore.
|
|
@mvriel I think we should add this in the future. It makes a lot of sense to have a description for the exprected callable. |
|
When looking at this feature request it seemed very plausible to have this. On the other hand It would be strange to add arguments to the callable type of our type resolver. Since the php type doesn't have any arguments. I don't know yet if and how we can implement this. Typically the arguments should be part of a some how complex description. Since we cannot modify the callable type for this. It looks like our current architecture is not able to support this use case. I will leave this open for further discussion. Maybe we will find a solution when PRS-5 is continued |
There should be support for callable definitions as types.
Currently this just makes the block fail to parse entirely.