Is it just me that thinks "Meh" when reading that Symfony moves away from PHP-Object or XML based configuration towards an array based config?

#symfony #php

@heiglandreas I don't think "meh", it's more like "wtf" in regard to moving away from objects. xml I don't really care about though.
Their thinking is that static analysis can handle type hinting for array structures. But if you can generate the info needed for static analysis tools, you can generate the php objects.
@doppynl Static analysis is fine. But it requires extra documentation instead of self-documenting code... 🤷
@heiglandreas @doppynl I built a system to map array config directly into typed objects a while back. It's quite simple, frankly. And gives you built in schema validation and typing.

@Crell @doppynl Don't get me wrong. I don't see the technicalities as an issue. That's a solved problem.

I am more thinking about the example it sets. Again.

@Crell @doppynl It signals that objects are too complicated. Arrays are much easier, so let's just drop objects. Or any other way of transporting internally typechecked information.

It is a statement to the community. As was for example leaving the framework interoperability group or reinventing/rebuilding existing and widely used libraries.

My personal opinion!

@heiglandreas @doppynl Absent a good typed object literal syntax, we need *some* kind of "somewhat easier to write" syntax for editing on disk. Arrays are not great, but the best of bad options. (YAML is worse.)

Though if it isn't getting mapped into typed objects in the application for validation and reading, You're Doing It Wrong.

@Crell @doppynl Why use an object literal syntax when you can use the object syntax.... 🤷
@heiglandreas @doppynl Unless you're objects are strictly structs, it may not be very ergonomic.