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.
Comment created by @ocramius:
https://github.com/doctrine/common/blob/2.4.0-RC2/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L386-L403 could be patched to verify if the method is byref/byval.
Comment created by stof:
This should probably be checked for all proxied methods, not only for magic ones
[~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
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?
Comment created by honzap:
Michael Moravec: Yes, this is ok. Now, proxy classes are generated well.
Cleaned and re-submitted at #281
Please review and then I'll merge.
Merged at d658ec7
Issue was closed with resolution "Fixed"