diff options
Diffstat (limited to 'vendor/doctrine/persistence/UPGRADE.md')
-rw-r--r-- | vendor/doctrine/persistence/UPGRADE.md | 154 |
1 files changed, 154 insertions, 0 deletions
diff --git a/vendor/doctrine/persistence/UPGRADE.md b/vendor/doctrine/persistence/UPGRADE.md new file mode 100644 index 0000000..d7f5b04 --- /dev/null +++ b/vendor/doctrine/persistence/UPGRADE.md | |||
@@ -0,0 +1,154 @@ | |||
1 | Note about upgrading: Doctrine uses static and runtime mechanisms to raise | ||
2 | awareness about deprecated code. | ||
3 | |||
4 | - Use of `@deprecated` docblock that is detected by IDEs (like PHPStorm) or | ||
5 | Static Analysis tools (like Psalm, phpstan) | ||
6 | - Use of our low-overhead runtime deprecation API, details: | ||
7 | https://github.com/doctrine/deprecations/ | ||
8 | |||
9 | # Upgrade to 3.3 | ||
10 | |||
11 | ## Added method `ObjectManager::isUninitializedObject()` | ||
12 | |||
13 | Classes implementing `Doctrine\Persistence\ObjectManager` should implement the new | ||
14 | method. This method will be added to the interface in 4.0. | ||
15 | |||
16 | # Upgrade to 3.1 | ||
17 | |||
18 | ## Deprecated `RuntimePublicReflectionProperty` | ||
19 | |||
20 | Use `RuntimeReflectionProperty` instead. | ||
21 | |||
22 | # Upgrade to 3.0 | ||
23 | |||
24 | ## Removed `OnClearEventArgs::clearsAllEntities()` and `OnClearEventArgs::getEntityClass()` | ||
25 | |||
26 | These methods only make sense when partially clearing the object manager, which | ||
27 | is no longer possible. | ||
28 | The second argument of the constructor of `OnClearEventArgs` is removed as well. | ||
29 | |||
30 | ## BC Break: removed `ObjectManagerAware` | ||
31 | |||
32 | Implement active record style functionality directly in your application, by | ||
33 | using a `postLoad` event. | ||
34 | |||
35 | ## BC Break: removed `AnnotationDriver` | ||
36 | |||
37 | Use `ColocatedMappingDriver` instead. | ||
38 | |||
39 | ## BC Break: Removed `MappingException::pathRequired()` | ||
40 | |||
41 | Use `MappingException::pathRequiredForDriver()` instead. | ||
42 | |||
43 | ## BC Break: removed `LifecycleEventArgs::getEntity()` | ||
44 | |||
45 | Use `LifecycleEventArgs::getObject()` instead. | ||
46 | |||
47 | ## BC Break: removed support for short namespace aliases | ||
48 | |||
49 | - `AbstractClassMetadataFactory::getFqcnFromAlias()` is removed. | ||
50 | - `ClassMetadataFactory` methods now require their `$className` argument to be an | ||
51 | actual FQCN. | ||
52 | |||
53 | ## BC Break: removed `ObjectManager::merge()` | ||
54 | |||
55 | `ObjectManagerDecorator::merge()` is removed without replacement. | ||
56 | |||
57 | ## BC Break: removed support for `doctrine/cache` | ||
58 | |||
59 | Removed support for using doctrine/cache for metadata caching. The | ||
60 | `setCacheDriver` and `getCacheDriver` methods have been removed from | ||
61 | `Doctrine\Persistence\Mapping\AbstractMetadata`. Please use `getCache` and | ||
62 | `setCache` with a PSR-6 implementation instead. | ||
63 | |||
64 | ## BC Break: changed signatures | ||
65 | |||
66 | `$objectName` has been dropped from the signature of `ObjectManager::clear()`. | ||
67 | |||
68 | ```diff | ||
69 | - public function clear($objectName = null) | ||
70 | + public function clear(): void | ||
71 | ``` | ||
72 | |||
73 | Also, native parameter type declarations have been added on all public APIs. | ||
74 | Native return type declarations have not been added so that it is possible to | ||
75 | implement types compatible with both 2.x and 3.x. | ||
76 | |||
77 | ## BC Break: Removed `PersistentObject` | ||
78 | |||
79 | Please implement this functionality directly in your application if you want | ||
80 | ActiveRecord style functionality. | ||
81 | |||
82 | # Upgrade to 2.5 | ||
83 | |||
84 | ## Deprecated `OnClearEventArgs::clearsAllEntities()` and `OnClearEventArgs::getEntityClass()` | ||
85 | |||
86 | These methods only make sense when partially clearing the object manager, which | ||
87 | is deprecated. | ||
88 | Passing a second argument to the constructor of `OnClearEventArgs` is | ||
89 | deprecated as well. | ||
90 | |||
91 | ## Deprecated `ObjectManagerAware` | ||
92 | |||
93 | Along with deprecating `PersistentObject`, deprecating `ObjectManagerAware` | ||
94 | means deprecating support for active record, which already came with a word of | ||
95 | warning. Please implement this directly in your application with a `postLoad` | ||
96 | event if you need active record style functionality. | ||
97 | |||
98 | ## Deprecated `MappingException::pathRequired()` | ||
99 | |||
100 | `MappingException::pathRequiredForDriver()` should be used instead. | ||
101 | |||
102 | # Upgrade to 2.4 | ||
103 | |||
104 | ## Deprecated `AnnotationDriver` | ||
105 | |||
106 | Since attributes were introduced in PHP 8.0, annotations are deprecated. | ||
107 | `AnnotationDriver` is an abstract class that is used when implementing concrete | ||
108 | annotation drivers in dependent packages. It is deprecated in favor of using | ||
109 | `ColocatedMappingDriver` to implement both annotation and attribute based | ||
110 | drivers. This will involve implementing `isTransient()` as well as | ||
111 | `__construct()` and `getReader()` to retain backward compatibility. | ||
112 | |||
113 | # Upgrade to 2.3 | ||
114 | |||
115 | ## Deprecated using short namespace alias syntax in favor of `::class` syntax. | ||
116 | |||
117 | Before: | ||
118 | |||
119 | ```php | ||
120 | $objectManager->find('MyPackage:MyClass', $id); | ||
121 | $objectManager->createQuery('SELECT u FROM MyPackage:MyClass'); | ||
122 | ``` | ||
123 | |||
124 | After: | ||
125 | |||
126 | ```php | ||
127 | $objectManager->find(MyClass::class, $id); | ||
128 | $objectManager->createQuery('SELECT u FROM '. MyClass::class); | ||
129 | ``` | ||
130 | |||
131 | # Upgrade to 2.2 | ||
132 | |||
133 | ## Deprecated `doctrine/cache` usage for metadata caching | ||
134 | |||
135 | The `setCacheDriver` and `getCacheDriver` methods in | ||
136 | `Doctrine\Persistence\Mapping\AbstractMetadata` have been deprecated. Please | ||
137 | use `getCache` and `setCache` with a PSR-6 implementation instead. Note that | ||
138 | even after switching to PSR-6, `getCacheDriver` will return a cache instance | ||
139 | that wraps the PSR-6 cache. Note that if you use a custom implementation of | ||
140 | doctrine/cache, the library may not be able to provide a forward compatibility | ||
141 | layer. The cache implementation MUST extend the | ||
142 | `Doctrine\Common\Cache\CacheProvider` class. | ||
143 | |||
144 | # Upgrade to 1.2 | ||
145 | |||
146 | ## Deprecated `ObjectManager::merge()` and `ObjectManager::detach()` | ||
147 | |||
148 | Please handle merge operations in your application, and use | ||
149 | `ObjectManager::clear()` instead. | ||
150 | |||
151 | ## Deprecated `PersistentObject` | ||
152 | |||
153 | Please implement this functionality directly in your application if you want | ||
154 | ActiveRecord style functionality. | ||