-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add support for asymmetric visibility for properties #43
Conversation
Here's the modifiers as returned by
1️⃣ - For comparison with the next line |
private static $ASYMMETRIC; | ||
|
||
static function __static() { | ||
self::$ASYMMETRIC= method_exists(\ReflectionProperty::class, 'isPrivateSet'); |
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.
This can be replaced by #[Runtime(version: '>=8.4')]
once the PR is merged.
Example
Given the following:
The modifiers class includes private(set) and protected(set) support:
The isPublic(), isProtected() and isPrivate() methods optionally support "get" or "set":
The modifiers() method can be used with "get" or "set" to produce views on the respective visibility:
Tests
The following configurations have run all unit tests successfully:
See also