From 4be25cb3308e60d4d0ccfb6828fb656a4225cbb0 Mon Sep 17 00:00:00 2001 From: "Fabio B. Silva" Date: Sun, 12 Aug 2012 22:35:06 -0300 Subject: [PATCH] small refactoring --- .../ORM/Mapping/DefaultEntityListenerResolver.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/Doctrine/ORM/Mapping/DefaultEntityListenerResolver.php b/lib/Doctrine/ORM/Mapping/DefaultEntityListenerResolver.php index 5f7d70410..2a68112b3 100644 --- a/lib/Doctrine/ORM/Mapping/DefaultEntityListenerResolver.php +++ b/lib/Doctrine/ORM/Mapping/DefaultEntityListenerResolver.php @@ -38,16 +38,15 @@ class DefaultEntityListenerResolver implements EntityListenerResolver */ public function clear($className = null) { - if ($className !== null) { - - if (isset($this->instances[$className = trim($className, '\\')])) { - unset($this->instances[$className]); - } + if ($className === null) { + $this->instances = array(); return; } - $this->instances = array(); + if (isset($this->instances[$className = trim($className, '\\')])) { + unset($this->instances[$className]); + } } /**