-
Notifications
You must be signed in to change notification settings - Fork 131
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
Pretty much compatible ReflectionMethod #58
Conversation
Does getInterfaces() work? On Fri, 10 Jul 2015 at 13:33 James Titcumb notifications@github.com wrote:
|
public function getModifiers() | ||
{ | ||
$val = 0; | ||
$val += $this->isStatic() ? \ReflectionMethod::IS_STATIC : 0; |
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.
$val = ($this->isStatic() & \ReflectionMethod::IS_STATIC)
| ($this->isPublic() & \ReflectionMethod::IS_PUBLIC)
| ($this->isProtected() & \ReflectionMethod::IS_PROTECTED)
| ($this->isPrivate() & \ReflectionMethod::IS_PRIVATE)
| ($this->isAbstract() & \ReflectionMethod::IS_ABSTRACT)
| ($this->isFinal() & \ReflectionMethod::IS_FINAL)
| ($this->isStatic() & \ReflectionMethod::IS_STATIC)
| ($this->isStatic() & \ReflectionMethod::IS_STATIC);
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.
Example is broken btw. true & 1 === 1
, true & 2 === 0
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.
$val = ($this->isStatic() ? 0 : \ReflectionMethod::IS_STATIC)
| ($this->isPublic() ? 0 : \ReflectionMethod::IS_PUBLIC)
| ($this->isProtected() ? 0 : \ReflectionMethod::IS_PROTECTED)
| ($this->isPrivate() ? 0 : \ReflectionMethod::IS_PRIVATE)
| ($this->isAbstract() ? 0 : \ReflectionMethod::IS_ABSTRACT)
| ($this->isFinal() ? 0 : \ReflectionMethod::IS_FINAL)
| ($this->isStatic() ? 0 : \ReflectionMethod::IS_STATIC)
| ($this->isStatic() ? 0 : \ReflectionMethod::IS_STATIC);
So yeah, ternaries -.-
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.
That.. also doesn't work.
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.
Alright, guess I'll just be ok with the current approach.
@GeeH |
Pretty much compatible ReflectionMethod
👍 |
Created new issue for
getPrototype()
cuz there's some janky logic there - see #57 plus we need to finishReflectionClass
first.This resolves the
ReflectionMethod
item on #7.