Skip to content

Commit d1c22c8

Browse files
committed
Merge upgrade guides
This is consistent with other packages such as doctrine/dbal
1 parent 8529c82 commit d1c22c8

File tree

4 files changed

+50
-21
lines changed

4 files changed

+50
-21
lines changed

UPGRADE-1.2.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

UPGRADE-2.2.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

UPGRADE-2.3.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

UPGRADE.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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 2.3
10+
11+
## Deprecated using short namespace alias syntax in favor of `::class` syntax.
12+
13+
Before:
14+
15+
```php
16+
$objectManager->find('MyPackage:MyClass', $id);
17+
$objectManager->createQuery('SELECT u FROM MyPackage:MyClass');
18+
```
19+
20+
After:
21+
22+
```php
23+
$objectManager->find(MyClass::class, $id);
24+
$objectManager->createQuery('SELECT u FROM '. MyClass::class);
25+
```
26+
27+
# Upgrade to 2.2
28+
29+
## Deprecated `doctrine/cache` usage for metadata caching
30+
31+
The `setCacheDriver` and `getCacheDriver` methods in
32+
`Doctrine\Persistence\Mapping\AbstractMetadata` have been deprecated. Please
33+
use `getCache` and `setCache` with a PSR-6 implementation instead. Note that
34+
even after switching to PSR-6, `getCacheDriver` will return a cache instance
35+
that wraps the PSR-6 cache. Note that if you use a custom implementation of
36+
doctrine/cache, the library may not be able to provide a forward compatibility
37+
layer. The cache implementation MUST extend the
38+
`Doctrine\Common\Cache\CacheProvider` class.
39+
40+
# Upgrade to 1.2
41+
42+
## Deprecated `ObjectManager::merge()` and `ObjectManager::detach()`
43+
44+
Please handle merge operations in your application, and use
45+
`ObjectManager::clear()` instead.
46+
47+
## Deprecated `PersistentObject`
48+
49+
Please implement this functionality directly in your application if you want
50+
ActiveRecord style functionality.

0 commit comments

Comments
 (0)