comparison vendor/zendframework/zend-stdlib/doc/book/migration.md @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 # Migration Guide
2
3 ## From v2 to v3
4
5 The changes made going from v2 to v3 were:
6
7 - Removal of the Hydrator subcomponent.
8 - Removal of the `CallbackHandler` class.
9 - Removal of `Zend\Stdlib\Guard\GuardUtils`.
10
11 ### Hydrators
12
13 The biggest single change from version 2 to version 3 is that the hydrator
14 subcomponent, which was deprecated in v2.7.0, is now removed. This means that if
15 you were using zend-stdlib principally for the hydrators, you need to convert
16 your code to use [zend-hydrator](https://github.com/zendframework/zend-hydrator).
17
18 This will also mean a multi-step migration. zend-stdlib v3 pre-dates
19 zend-hydrator v2.1, which will be the first version that supports zend-stdlib v3
20 and zend-servicemanager v3. If you are using Composer, the migration should be
21 seamless:
22
23 - Remove your zend-stdlib dependency:
24
25 ```bash
26 $ composer remove zendframework/zend-stdlib
27 ```
28
29 - Update to use zend-hydrator:
30
31 ```bash
32 $ composer require zendframework/zend-hydrator
33 ```
34
35 When zend-hydrator updates to newer versions of zend-stdlib and
36 zend-servicemanager, you will either automatically get those versions, or you
37 can tell composer to use those specific versions:
38
39 ```bash
40 $ composer require "zendframework/zend-stdlib:^3.0"
41 ```
42
43 ### CallbackHandler
44
45 `Zend\Stdlib\CallbackHandler` primarily existed for legacy purposes; it was
46 created before the `callable` typehint existed, so that we could typehint PHP
47 callables. It also provided some minimal features around lazy-loading callables
48 from instantiable classes, but these features were rarely used, and better
49 approaches already exist for handling such functinality in zend-servicemanager
50 and zend-expressive.
51
52 As such, the class was marked deprecated in v2.7.0, and removed for v3.0.0.
53
54 ### GuardUtils
55
56 Version 3 removes `Zend\Stdlib\Guard\GuardUtils`. This abstract class existed to
57 provide the functionality of the various traits also present in that
58 subcomponent, for consumers on versions of PHP earlier than 5.4. Since the
59 minimum required version is now PHP 5.5, the class is unnecessary. If you were
60 using it previously, compose the related traits instead.