Skip to content

Loading…

DCOM-194: Creating Proxy class failure for own __get method #496

Closed
doctrinebot opened this Issue · 8 comments

2 participants

@doctrinebot

Jira issue originally created by user honzap:

Nette framework (http://nette.org) has got own Nette\Object as a base of other objects. It also rewrite the default **get method in PHP object but it uses definition with pointer:

public function &**get($name)

Doctrine Common creates Proxy classes with **get method too but not with reference. It causes an error using strict warning:

Declaration of Proxy\*_CG__\MyEntityObject::__get() should be compatible with & Nette\Object::_*get($name)

The problem is in ProxyGenerator. Locally I've patched it in my Doctrine repository clone but don't know how to resolve it globally.

@doctrinebot

Comment created by stof:

This should probably be checked for all proxied methods, not only for magic ones

@doctrinebot

Comment created by @ocramius:

[~stof] I think I already check proxied methods, but didn't apply that logic for magic methods.

edit: indeed, there's a test for that: https://github.com/doctrine/common/blob/2.4.0-RC3/tests/Doctrine/Tests/Common/Proxy/LazyLoadableObject.php#L101-L106

@doctrinebot

Comment created by majkl578:

Hello, I've patched ProxyGenerator::generateMagicGet method to support reference, see Github PR #278.
Jan Pecek, could you confirm it fixes the problem?

@doctrinebot

Comment created by honzap:

Michael Moravec: Yes, this is ok. Now, proxy classes are generated well.

@doctrinebot

Comment created by @ocramius:

Cleaned and re-submitted at #281

Please review and then I'll merge.

@doctrinebot

Comment created by @ocramius:

Merged at d658ec7

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added the Bug label
@Ocramius Ocramius was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.4 milestone
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.