Yonel Ceruto

Results 138 comments of Yonel Ceruto

This look like a fantastic addition for simple forms, but honestly I'm not 100% sure for mid-level and complex forms. PHP attributes are excellent for declaratively adding metadata, but there...

```php $form = $formFactory->create(UserDTO::class, $user); ``` It looks strange from the design PoV passing the DTO class as form type. I’m wondering if, instead of passing the data class, we...

>I think its a good start to keep it simple yes. We just need to set the limit to which capabilities we want to replicate. There are implicit limitations with...

>I also thought of a command that can "convert" an attribute form to a traditional FormType, something like make:form:from-metadata. WDYT? Yes, but what about just creating a command that generate...

>And Im totally agree to something like : >$form = $formFactory->create(null, $user); >// or even? >$form = $formFactory->create($user); even `$form = $formFactory->create(data: $user)` is fine currently

>Still one class less, less code: > >Traditional (with DTO): Entity + DTO + FormType >Attributes (with DTO) : Entity + DTO In terms of number of classes, yes. But...

I loved the auto form example, but I’m afraid it would work only as a sample. In practice, you’ll need to define at least the field type to match the...

```diff + /** + * @param Product[] $products + */ #[Route(path: "/products", methods: "POST")] public function __invoke( - #[MapRequestPayload(type: Product::class)] array $products, + #[MapRequestPayload] array $products, ): Response { }...

> I was wondering if we couldn't go with another API, namely a new argument to the constructor of the Parameter class? > >`new Parameter(string $id, string $errorOnEmpty = null)`...

>I would not add this in setParameter() as this would mean that each place setting the value of a parameter would have to define the proper validation (while in many...