Skip to content

Use method return type as fallback in 2.x  #7

@codeliner

Description

@codeliner

@arnedesmedt I had to change your PHP 7.4 implementation a bit, due to ReflectionType::__toString() being deprecated. See #6
I also added the exception back. Now it's thrown when the property has no type hint. However, we could also use the old logic (method return type) as a fallback in case no property type hint is given.
This would ease the migration path from 1.x to 2.x because you don't have to change all your ImmutableRecords at once. What do you think? Can you provide a PR for it and maybe also add some test cases?

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