D6342: Add more typehints to arguments in PHP
noreply at phabricator.kde.org
Tue Jun 27 13:06:22 UTC 2017
mtijink updated this revision to Diff 15918.
mtijink added a comment.
I also added type support for `iterable` (previous, it only parsed correctly), which either is an array or an object which implements `Traversable`. Could someone look at this, give some comments and (if okay) merge it?
Also, I still do not know how the issues I mentioned earlier should be handled:
- How should I add support for `self`? Adding it as a token gave all kinds of problems. //Update:// adding it by detecting `self` as a class before assigning the typehint works, but might not be the ideal solution.
- 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.
R52 KDevelop: PHP Support
CHANGES SINCE LAST UPDATE
To: mtijink, #kdevelop, pprkut
Cc: apol, kdevelop-devel, geetamc, Pilzschaf, akshaydeo, surgenight, arrowdodger
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the KDevelop-devel