Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

use the extended proxy interface in the same namespace #597

Merged
merged 1 commit into from

6 participants

@MDrollette

Fix for this error:

FatalErrorException: Compile Error: Cannot use Doctrine\Common\Proxy\Proxy as Proxy because the name is already in use in .../vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/ProxyFactory.php line 26
@doctrinebot
Collaborator

Hello,

thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link:

http://doctrine-project.org/jira/browse/DDC-2328

@stof

This change is wrong. The typehint should actually be the interface from Common

@MDrollette

ok, aliased the common interface instead.

@Ocramius
Owner

@MDrollette what environment are you on? (asking because I never experienced this one)

@stof

@Ocramius early PHP 5.3 releases are producing this issue

@Ocramius
Owner

Gotcha. Really weird one...

@stof

and only if both files are loaded

@MDrollette
@caseyw

I just had this occur on the prod env. I performed the alias changes above and that fixed it.

To note, it worked before in dev but when I tried on prod is when it failed.

@guilhermeblanco guilhermeblanco merged commit b30d6df into doctrine:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/Doctrine/ORM/Proxy/ProxyFactory.php
View
8 lib/Doctrine/ORM/Proxy/ProxyFactory.php
@@ -23,7 +23,7 @@
use Doctrine\Common\Proxy\AbstractProxyFactory;
use Doctrine\Common\Proxy\ProxyDefinition;
use Doctrine\Common\Util\ClassUtils;
-use Doctrine\Common\Proxy\Proxy;
+use Doctrine\Common\Proxy\Proxy as BaseProxy;
use Doctrine\Common\Proxy\ProxyGenerator;
use Doctrine\ORM\ORMInvalidArgumentException;
use Doctrine\ORM\Persisters\BasicEntityPersister;
@@ -116,7 +116,7 @@ protected function createProxyDefinition($className)
private function createInitializer(ClassMetadata $classMetadata, BasicEntityPersister $entityPersister)
{
if ($classMetadata->getReflectionClass()->hasMethod('__wakeup')) {
- return function (Proxy $proxy) use ($entityPersister, $classMetadata) {
+ return function (BaseProxy $proxy) use ($entityPersister, $classMetadata) {
$proxy->__setInitializer(null);
$proxy->__setCloner(null);
@@ -141,7 +141,7 @@ private function createInitializer(ClassMetadata $classMetadata, BasicEntityPers
};
}
- return function (Proxy $proxy) use ($entityPersister, $classMetadata) {
+ return function (BaseProxy $proxy) use ($entityPersister, $classMetadata) {
$proxy->__setInitializer(null);
$proxy->__setCloner(null);
@@ -177,7 +177,7 @@ private function createInitializer(ClassMetadata $classMetadata, BasicEntityPers
*/
private function createCloner(ClassMetadata $classMetadata, BasicEntityPersister $entityPersister)
{
- return function (Proxy $proxy) use ($entityPersister, $classMetadata) {
+ return function (BaseProxy $proxy) use ($entityPersister, $classMetadata) {
if ($proxy->__isInitialized()) {
return;
}
Something went wrong with that request. Please try again.