EasyAdminBundle icon indicating copy to clipboard operation
EasyAdminBundle copied to clipboard

Abstracted more repeating code, added abstract for fields, made creat…

Open bytes-commerce opened this issue 2 years ago • 1 comments

…ion of new fields more streamlined and adapted signature to match possible inputs more strictly.

This PR streamlines how Fields are generated; instead of lots of code duplication (that increases the costs for maintenance), we can deduct it to an Abstract.

In an attempt to further reduce abstracts, this change can be later on used to even further simplify static calls by having the full API of the fields at hand.

bytes-commerce avatar Nov 07 '23 11:11 bytes-commerce

I've marked the usage of false $label as deprecated; in my opinion makes no sense to pass a boolean when you expect null or a string. We should be more strict with what we expect, to reduce complexity and improve the overall developer experience.

Further, we do not have any case for passing true, so allowing false (instead of bool) seems not ideal in terms of the design.

Hidden, as its not going to be deprecated. :man_shrugging:

bytes-commerce avatar Nov 07 '23 12:11 bytes-commerce