In php 7.0 and php 7.1, new type hints were added. I would like to see those supported in KDevelop.
This patch adds support for most of the new type hints (only "self" is missing), but some types do not get a better resulting DUChain type, since I do not know how to add the types "iterable" and "callable" in the DUChain.
Since this is my first patch, I also have some questions, which I hope you can answer:
- How should I add support for "self"? Adding it as a token gave all kinds of problems.
- How should the "callable" type be represented? It should accept any kind of function, but I only saw support for types with known function signatures
- This patch added some tokens, so they cannot be used as class names and constants anymore. This is a problem, I think, since PHP < 7 still allows e.g. "int" as class name. Another problem is that the newer keywords (e.g. "iterable", "int") can still be used as names for constants (but not for classes etc.), which is not allowed with this code either.
Feedback very welcome!