File: UPGRADE.md

package info (click to toggle)
php-doctrine-data-fixtures 2.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 564 kB
  • sloc: php: 3,148; makefile: 20
file content (82 lines) | stat: -rw-r--r-- 2,780 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Note about upgrading: Doctrine uses static and runtime mechanisms to raise
awareness about deprecated code.

- Use of `@deprecated` docblock that is detected by IDEs (like PHPStorm) or
  Static Analysis tools (like Psalm, phpstan)
- Use of our low-overhead runtime deprecation API, details:
  https://github.com/doctrine/deprecations/

# Upgrade to 2.0

You need PHP 8.1 or newer to use this library.

## BC BREAK: Add native types declarations to all the methods

All types defined in phpdoc annotations are now defined natively,
they must be added to your code if you extend the classes or implement the interfaces.

## Loggers have to implement the PSR-3 contracts

* Passing a callable to `AbstractExecutor::setLogger()` is not possible anymore, pass a PSR-3 logger instead.
* The method `AbstractExecutor::log()` has been removed without replacement.

## Specifying the class is mandatory when loading references

For the following method, the `class` param is now mandatory:
- `AbstractFixture::getReference`
- `AbstractFixture::hasReference`
- `ReferenceRepository::setReferenceIdentity`
- `ReferenceRepository::hasIdentity`
- `ReferenceRepository::getReference`
- `ReferenceRepository::setReference`

The following method was removed:
- `ReferenceRepository::getReferences`

The following classes are now final, each of them has an interface you can implement:
- `Doctrine\Common\DataFixtures\Executor\MongoDBExecutor`
- `Doctrine\Common\DataFixtures\Executor\ORMExecutor`
- `Doctrine\Common\DataFixtures\Executor\PHPCSExecutor`
- `Doctrine\Common\DataFixtures\Purger\MongoDBPurger`
- `Doctrine\Common\DataFixtures\Purger\ORMPurger`
- `Doctrine\Common\DataFixtures\Purger\PHPCSPurger`

# Upgrade to 1.8

## Deprecated closure loggers in favor of PSR-3

* Passing a callable to `AbstractExecutor::setLogger()` is deprecated, pass a PSR-3 logger instead.
* The method `AbstractExecutor::log()` is deprecated without replacement.

## Finalized classes

Executor and Purger classes are final, they cannot be extended.
`AbstractExecutor` is internal. It cannot be extended or used as typehint.

# Upgrade to 1.6

## BC BREAK: `CircularReferenceException` no longer extends `Doctrine\Common\CommonException`

We don't think anyone catches this exception in a `catch (CommonException)` statement.

## `doctrine/data-fixtures` no longer requires `doctrine/common`

If you rely on types from `doctrine/common`, you should require that package, regardless of whether other packages require it.

# Between v1.0.0-ALPHA1 and v1.0.0-ALPHA2

The FixtureInterface was changed from

    interface FixtureInterface
    {
        load($manager);
    }

to

    use Doctrine\Common\Persistence\ObjectManager;

    interface FixtureInterface
    {
        load(ObjectManager $manager);
    }