Hi!
On 06.10.20 17:15, Sara Golemon wrote:
My opinion on constructor property promotion (CPP) is that it's something
for small value object classes and should probably be regarded as
code-smell on larger classes. At the same time, annotations belong with
more complex objects and not so much with small "struct-like" classes.
Just wanted to chime in on this:
I can foresee already the impact CPP will have on dependency injection:
sometimes you just have complex business logic with lots of (auto-wired)
dependencies and have to pull in n+1 classes into the constructor.
Currently 5+ deps create 3*(5+) codelines for not much value. My point
is that I see much more value _outside_ of "value object classes" with
auto-wiring, reducing boilerplate _a lot_.
That said: I err on the side of forbidding it, if we've no clear
consensus how to do it!
thanks,
- Makrs
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php