Skip to content

Allow CasterFactory/SerializerFactory to read CastWith/SerializeWith attributes from interfaces #1882

@oruborus

Description

@oruborus

Description

When casting or serializing propertys that are typed to an interface the CasterFactory/SerializerFactory do not read the CastWith/SerializeWith attributes from interfaces definition.

As I see it, changes (if ($*With === null && ($type->isClass() || $type->isInterface())) {) need to be made here:

if ($castWith === null && $type->isClass()) {

and here:

if ($serializeWith === null && $type->isClass()) {

Benefits

Less need for adding CastWith/SerializeWith attributes to properties typed to interfaces and more getting out of the way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions