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

DCOM-282: Use call_user_func_array in proxy classes #594

Open
doctrinebot opened this issue Apr 9, 2015 · 2 comments
Open

DCOM-282: Use call_user_func_array in proxy classes #594

doctrinebot opened this issue Apr 9, 2015 · 2 comments
Assignees

Comments

@doctrinebot
Copy link

Jira issue originally created by user jacksleight:

At the moment the proxy generator creates methods like this:

    public function type()
    {

        $this->*_initializer__ && $this->__initializer__->_*invoke($this, 'type', array());

        return parent::type();
    }

However, this breaks methods in the entity class that rely on func*num_args or func_get*args (eg. a method that can have variable arguments), as only the defined arguments are passed through to the parent method.

I would like to suggest changing the proxy generator to output code like this:

    public function type()
    {

        $this->*_initializer__ && $this->__initializer__->_*invoke($this, 'type', array());

        $args = func*get*args();
        return call*user_func*array('parent::type', $args);
    }

So that all arguments are passed through.

I'd be happy to create a pull request for this, unless there's a reason why you wouldn't want to do it that way?

@doctrinebot
Copy link
Author

@doctrinebot
Copy link
Author

Comment created by @Ocramius:

This is indeed a known issue, and it wasn't fixed due to performance reasons.

You may want to check doctrine/orm#1241, which also fixes this issue.

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

No branches or pull requests

2 participants