-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReflectionClass::getConstant()
, getConstants()
and getImmediateConstants()
more consistent with methods and properties methods
#1231
Conversation
…nts() return ReflectionClassConstant instance Methods getReflectionConstant(), getReflectionConstants() and getImmediateReflectionConstants() were removed
*/ | ||
public function getConstant(string $name): string|int|float|bool|array|null | ||
public function getImmediateConstants(int|null $filter = null): array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we only stick to int $filter
, we should document its bitmask type precisely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ocramius Can I prepare everything in next PR? I will change it for methods and properties as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure 👍
* | ||
* @return scalar|array<scalar>|null | ||
* @return array<string, ReflectionClassConstant> indexed by name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-empty-string
keys?
* @return array<string, ReflectionClassConstant> indexed by name | ||
*/ | ||
public function getImmediateReflectionConstants(): array | ||
public function getConstant(string $name): ReflectionClassConstant|null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should only accept non-empty-string
as name
ReflectionClassConstant
instances