Skip to content

Add nullable information to ArgumentMetadata #809

@fritz-gerneth

Description

@fritz-gerneth

Working on some custom ArgumentResolver, it would be good to know if an argument is nullable. This would allow us to either return null or throw an exception in the ArgumentResolver::resolve call (e.g. when the header is not present in the message). Right now this does throw some Type error that null is given.

Proposed Change: extend ArgumentMetadata with an additional property bool $allowsNull (same name as the method in the ReflectionParameter)

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