From 119c4eca57476a48b3da26dff13ed8c1b7d2213e Mon Sep 17 00:00:00 2001 From: jwage Date: Thu, 18 Mar 2010 21:30:09 +0000 Subject: [PATCH] [2.0] Fixing coding standards of generated proxies --- lib/Doctrine/ORM/Proxy/ProxyFactory.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/lib/Doctrine/ORM/Proxy/ProxyFactory.php index e30112b23..e6d413d84 100644 --- a/lib/Doctrine/ORM/Proxy/ProxyFactory.php +++ b/lib/Doctrine/ORM/Proxy/ProxyFactory.php @@ -197,7 +197,8 @@ class ProxyFactory } } - $methods .= $parameterString . ') {' . PHP_EOL; + $methods .= $parameterString . ')'; + $methods .= PHP_EOL . ' {' . PHP_EOL; $methods .= ' $this->_load();' . PHP_EOL; $methods .= ' return parent::' . $method->getName() . '(' . $argumentString . ');'; $methods .= PHP_EOL . ' }' . PHP_EOL; @@ -242,19 +243,23 @@ class ProxyFactory /** Reference Proxy class code template */ private static $_proxyClassTemplate = ' { +namespace +{ /** * THIS CLASS WAS GENERATED BY THE DOCTRINE ORM. DO NOT EDIT THIS FILE. */ - class extends \ implements \Doctrine\ORM\Proxy\Proxy { + class extends \ implements \Doctrine\ORM\Proxy\Proxy + { private $_entityPersister; private $_identifier; public $__isInitialized__ = false; - public function __construct($entityPersister, $identifier) { + public function __construct($entityPersister, $identifier) + { $this->_entityPersister = $entityPersister; $this->_identifier = $identifier; } - private function _load() { + private function _load() + { if (!$this->__isInitialized__ && $this->_entityPersister) { $this->__isInitialized__ = true; if ($this->_entityPersister->load($this->_identifier, $this) === null) { @@ -267,7 +272,8 @@ namespace { - public function __sleep() { + public function __sleep() + { if (!$this->__isInitialized__) { throw new \RuntimeException("Not fully loaded proxy can not be serialized."); }