Skip to content

Consider making Roave\BetterReflection\Reflection\ReflectionClass#getMethod() non-nullable? #1275

Open
@Ocramius

Description

We currently have:

  • Roave\BetterReflection\Reflection\ReflectionClass#getMethod(): ReflectionMethod|null
  • Roave\BetterReflection\Reflection\ReflectionClass#hasMethod(): bool

This API is kinda dumb-ish, and we kinda went back on it in 6.0.0, IMO: an exception being thrown was probably a much nicer API here.

Either we make getMethod() throw, or we remove hasMethod() here. Relying on getMethod() throwing is not so bad here, but either way could work.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions