Skip to content

Wrong values in PropertyMetadata - how does a factory decorator know if a value is "authoritative"? #480

Closed
@teohhanhui

Description

@teohhanhui

PropertyInfoPropertyMetadataFactory sets writable to false on to-many relations (Doctrine Collection), due to its inability to find the singular-named adder and remover methods - see symfony/symfony#18166; and in SerializerPropertyMetadataFactory we do not change any existing false values on readable/writable, since we cannot know whether it's safe to do so. This leads to incorrect result - basically all to-many relations having writable value of false. (Our functional testing does not catch this because Dummy::relatedDummies is a public property.)

But this is a more general problem. How does a factory decorator know when it's okay / not okay to "overrule" the value set by its predecessor(s)? Does there need to be a confidence value attached? Or even a voting system like that of Symfony Security component? (I'm not sure if I'm going in the right direction...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions