Skip to content
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

Merged
merged 4 commits into from
Jul 10, 2015
Merged

Conversation

asgrim
Copy link
Member

@asgrim asgrim commented Jul 10, 2015

Created new issue for getPrototype() cuz there's some janky logic there - see #57 plus we need to finish ReflectionClass first.

This resolves the ReflectionMethod item on #7.

@GeeH
Copy link
Collaborator

GeeH commented Jul 10, 2015

Does getInterfaces() work?

On Fri, 10 Jul 2015 at 13:33 James Titcumb notifications@github.com wrote:

Created new issue for getPrototype() cuz there's some janky logic there -
see #57 #57 plus we
need to finish ReflectionClass first.

This resolves the ReflectionMethod item on #7

#7.

You can view, comment on, or merge this pull request online at:

#58
Commit Summary

  • Added ReflectionMethod->getModifiers()
  • Added incomplete implementation of ReflectionMethod->getPrototype()
  • Updated compatibility.md

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#58.

public function getModifiers()
{
$val = 0;
$val += $this->isStatic() ? \ReflectionMethod::IS_STATIC : 0;
Copy link
Member

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);

Copy link
Member

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

Copy link
Member

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 -.-

Copy link
Member Author

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.

Copy link
Member

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.

@asgrim
Copy link
Member Author

asgrim commented Jul 10, 2015

@GeeH getInterfaces() does not yet work - I thought you were implementing it? ;)

Ocramius added a commit that referenced this pull request Jul 10, 2015
Pretty much compatible ReflectionMethod
@Ocramius Ocramius merged commit b0a5aad into master Jul 10, 2015
@Ocramius Ocramius deleted the compat-reflectionmethod branch July 10, 2015 14:39
@Ocramius
Copy link
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants