Skip to content

Conversation

@joelwurtz
Copy link
Member

@joelwurtz joelwurtz commented Jan 22, 2026

It allow having :

class Foo
{
    #[MapTo(transformer: new CustomTransformer())]
    public string $foo;
}

class CustomTransformer
{
    public function __invoke($value, $source, $context)
    {
       // ...
       return $transformedValue;
    }
}

@joelwurtz
Copy link
Member Author

I'm not sure how we should handle this with the already existing PropertyTransformerInterface which is done when we want to pass a service (with other dependencies).

Should we merge both cases into a single interface ?

@joelwurtz joelwurtz force-pushed the feat/invokable-transformer branch from 9afe43a to 1a5ea0e Compare January 26, 2026 13:36
Copy link
Member

@Korbeil Korbeil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think we need to merge the interface with it now

@joelwurtz joelwurtz merged commit f1f7ef0 into main Jan 26, 2026
5 checks passed
@joelwurtz joelwurtz deleted the feat/invokable-transformer branch January 26, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants