[HttpKernel] removed the need to use reflection to get a bundle namespace

This commit is contained in:
Fabien Potencier 2013-08-15 15:54:09 +02:00
parent d1ef0f3fdd
commit 49fe3c7c39

View File

@ -109,11 +109,9 @@ abstract class Bundle extends ContainerAware implements BundleInterface
*/ */
public function getNamespace() public function getNamespace()
{ {
if (null === $this->reflected) { $class = get_class($this);
$this->reflected = new \ReflectionObject($this);
}
return $this->reflected->getNamespaceName(); return substr($class, 0, strrpos($class, '\\'));
} }
/** /**