Skip to content

#[SourceField] implies usage of getter methods #756

Description

@er1z

Hello!

Don't know if I overlooked a thing: I have a value object that I want to expose via type. Value object is rather simple:

class Value {
    public function __construct() {
       public readonly int $something;
    }
}

And my type:

#[SourceField('something')]
class ValueType {
}

And then I get: There is an issue with a @SourceField annotation in class …: Could not find a getter or a isser for field.

Is this an intentional thing or missing feature? From what I checked against the codebase, there's no support for reading properties directly. But may be I am holding it wrong.

It would be nice not to have getters in type just to work around it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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