| title | Upgrade |
|---|
This is a list of backwards compatibility (BC) breaks introduced in ProxyManager:
- The Generated Hydrator has been removed - it is now available as a separate project at Ocramius/GeneratedHydrator #65
- When having a
public function __get($name)defined (by-val) and public properties, it won't be possible to get public properties by-ref while initializing the object. Either drop__get()or implement a by-ref& __get()#126 - Proxies are now being always auto-generated if they could not be autoloaded by a factory. The methods
ProxyManager\Configuration#setAutoGenerateProxies()andProxyManager\Configuration#doesAutoGenerateProxies()are now no-op and deprecated, and will be removed in the next minor version #87 #90 - Proxy public properties defaults are now set before initialization #116 #122
- An optional parameter
$optionswas introduced inProxyManager\Inflector\ClassNameInflectorInterface#getProxyClassName($className, array $options = array())parametrize the generated class name as of #10 and #59 - Generated hydrators no longer have constructor arguments. Any required reflection instantiation is now dealt with in the hydrator internally as of #63
- Interface names are also supported for proxy generation as of #40
- Generated hydrators were introduced
- An additional (optional) by-ref parameter was added to the lazy loading proxies' initializer to allow unsetting the initializer with less overhead.
- Dependency to jms/cg removed
- Moved code generation logic to
Zend\Code - Added method
ProxyManager\Inflector\ClassNameInflectorInterface#isProxyClassName($className) - The constructor of
ProxyManager\Autoloader\Autoloaderchanged from__construct(\ProxyManager\FileLocator\FileLocatorInterface $fileLocator)to__construct(\ProxyManager\FileLocator\FileLocatorInterface $fileLocator, \ProxyManager\Inflector\ClassNameInflectorInterface $classNameInflector) - Classes implementing
CG\Core\GeneratorStrategyInterfacenow implementProxyManager\GeneratorStrategy\GeneratorStrategyInterfaceinstead - All code generation logic has been replaced - If you wrote any logic based on
ProxyManager\ProxyGenerator, you will have to rewrite it
-
The signature of initializers to be used with proxies implementing
ProxyManager\Proxy\LazyLoadingInterfacechanged from:$initializer = function ($proxy, & $wrappedObject, $method, $parameters) {};
to
$initializer = function (& $wrappedObject, $proxy, $method, $parameters) {};
Only the order of parameters passed to the closures has been changed.