UPGRADE.md 6.2 KB


title: Upgrade

This is a list of backwards compatibility (BC) breaks introduced in ProxyManager:

2.0.0

  • PHP ~7.0 is now required to use ProxyManager
  • HHVM compatibility is not guaranteed, as HHVM is not yet PHP 7 compliant
  • All classes and interfaces now use strict scalar type hints. If you extended or implemented anything from the ProxyManager\ namespace, you probably need to change that code to adapt it to the new signature.
  • All classes and interfaces now use return type declarations. If you extended or implemented anything from the ProxyManager\ namespace, you probably need to change that code to adapt it to the new signature.
  • ProxyManager will no longer write proxies to disk by default: the EvaluatingGeneratorStrategy is used instead. If you still want ProxyManager to write files to disk, please refer to the tuning for production docs
  • Ghost objects were entirely rewritten, for better support and improved performance. Lazy-loading is not triggered by public API access, but by property access (private and public). While this is not really a BC break, you are encouraged to check your applications if you rely on ghost objects.
  • If ProxyManager can't find a proxy, it will now automatically attempt to auto-generate it, regardless of the settings passed to it.
  • ProxyManager\Configuration#setAutoGenerateProxies() was removed. Please look for calls to this method and remove them.
  • Private properties are now also correctly handled by ProxyManager: accessing proxy state via friend classes (protected or private scope) does not require any particular workarounds anymore.
  • ProxyManager\Version::VERSION was removed. Please use ProxyManager\Version::getVersion() instead.
  • PHP 4 style constructors are no longer supported

1.0.0

1.0.0 is be fully compatible with 0.5.0.

0.5.0

0.4.0

0.3.4

  • Interface names are also supported for proxy generation as of #40

0.3.3

0.3.2

  • An additional (optional) by-ref parameter was added to the lazy loading proxies' initializer to allow unsetting the initializer with less overhead.

0.3.0

0.2.0

  • The signature of initializers to be used with proxies implementing ProxyManager\Proxy\LazyLoadingInterface changed 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.