> Reading it - > http://doctrine-common.readthedocs.org/en/latest/reference/annotations.html - > it looks pretty big - strictly typed values, named > parameters, default constructors linked to properties, support for enum > types, support for typed arrays, separate constant syntax within > annotations. These are all features not supported in PHP, and it seems a > bit weird to me to have mini-language inside PHP that would support > these. And, of course, arbitrary depth recursive annotations, and for > some reason separate array syntax using {} and not [].
>From my point of view, most of this complexity is accidental. This happened mostly because, of course, we couldn't have parser / runtime errors inside doc comments. Once we have core annotations, oustide of doc comments, mostly of the DSL described in http://doctrine-common.readthedocs.org/en/latest/reference/annotations.html becomes unnecessary. 2014-11-04 15:17 GMT-03:00 Stas Malyshev <[email protected]>: > Hi! > >> All projects mentioned in this thread use: >> http://doctrine-common.readthedocs.org/en/latest/reference/annotations.html >> That makes a pretty good base spec. > Reading it, it looks pretty big - strictly typed values, named > parameters, default constructors linked to properties, support for enum > types, support for typed arrays, separate constant syntax within > annotations. These are all features not supported in PHP, and it seems a > bit weird to me to have mini-language inside PHP that would support > these. And, of course, arbitrary depth recursive annotations, and for > some reason separate array syntax using {} and not []. > Moreover, there's extensive checking for annotations with exceptions > thrown if any of the above doesn't typecheck - I'm not even sure where > that would fit in PHP parser. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
