D6342: Add more typehints to arguments in PHP
noreply at phabricator.kde.org
Thu Jun 22 12:57:31 UTC 2017
mtijink created this revision.
mtijink added a project: KDevelop.
Restricted Application added a subscriber: kdevelop-devel.
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!
R52 KDevelop: PHP Support
To: mtijink, #kdevelop
Cc: kdevelop-devel, geetamc, Pilzschaf, akshaydeo, surgenight, arrowdodger
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the KDevelop-devel