Chris@0: # Migration Guide Chris@0: Chris@0: ## From v2 to v3 Chris@0: Chris@0: The changes made going from v2 to v3 were: Chris@0: Chris@0: - Removal of the Hydrator subcomponent. Chris@0: - Removal of the `CallbackHandler` class. Chris@0: - Removal of `Zend\Stdlib\Guard\GuardUtils`. Chris@0: Chris@0: ### Hydrators Chris@0: Chris@0: The biggest single change from version 2 to version 3 is that the hydrator Chris@0: subcomponent, which was deprecated in v2.7.0, is now removed. This means that if Chris@0: you were using zend-stdlib principally for the hydrators, you need to convert Chris@0: your code to use [zend-hydrator](https://github.com/zendframework/zend-hydrator). Chris@0: Chris@0: This will also mean a multi-step migration. zend-stdlib v3 pre-dates Chris@0: zend-hydrator v2.1, which will be the first version that supports zend-stdlib v3 Chris@0: and zend-servicemanager v3. If you are using Composer, the migration should be Chris@0: seamless: Chris@0: Chris@0: - Remove your zend-stdlib dependency: Chris@0: Chris@0: ```bash Chris@0: $ composer remove zendframework/zend-stdlib Chris@0: ``` Chris@0: Chris@0: - Update to use zend-hydrator: Chris@0: Chris@0: ```bash Chris@0: $ composer require zendframework/zend-hydrator Chris@0: ``` Chris@0: Chris@0: When zend-hydrator updates to newer versions of zend-stdlib and Chris@0: zend-servicemanager, you will either automatically get those versions, or you Chris@0: can tell composer to use those specific versions: Chris@0: Chris@0: ```bash Chris@0: $ composer require "zendframework/zend-stdlib:^3.0" Chris@0: ``` Chris@0: Chris@0: ### CallbackHandler Chris@0: Chris@0: `Zend\Stdlib\CallbackHandler` primarily existed for legacy purposes; it was Chris@0: created before the `callable` typehint existed, so that we could typehint PHP Chris@0: callables. It also provided some minimal features around lazy-loading callables Chris@0: from instantiable classes, but these features were rarely used, and better Chris@0: approaches already exist for handling such functinality in zend-servicemanager Chris@0: and zend-expressive. Chris@0: Chris@0: As such, the class was marked deprecated in v2.7.0, and removed for v3.0.0. Chris@0: Chris@0: ### GuardUtils Chris@0: Chris@0: Version 3 removes `Zend\Stdlib\Guard\GuardUtils`. This abstract class existed to Chris@0: provide the functionality of the various traits also present in that Chris@0: subcomponent, for consumers on versions of PHP earlier than 5.4. Since the Chris@0: minimum required version is now PHP 5.5, the class is unnecessary. If you were Chris@0: using it previously, compose the related traits instead.