Skip to content

Default __toString() implementations for ValueObjectTrait, SingleValueObjectTrait and EnumTrait #4

Description

@lhellemons

It would be nice if value objects and enums could be outfitted with a 'default' __toString() implementation that returns a meaningful expression of their value.

Suggested format:

  • for EnumTrait: simply the instance ID.
  • for SingleValueObjectTrait: simply the serialized value.
  • for ValueObjectTrait: a concatenation of the stringified constructor arguments, similar to the default toString implementation for data classes in many languages

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions