Skip to content

Commit fc287b2

Browse files
committed
Merge branch '3.0.x' into 2.11.x-merge-up-into-3.0.x_gaayDumb
2 parents bfed8cb + 4b1a419 commit fc287b2

File tree

315 files changed

+1126
-17695
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

315 files changed

+1126
-17695
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 3 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,11 @@ jobs:
1919
strategy:
2020
matrix:
2121
php-version:
22-
- "7.2"
23-
- "7.3"
24-
- "7.4"
2522
- "8.0"
2623
- "8.1"
2724
dbal-version:
2825
- "default"
2926
include:
30-
- php-version: "8.0"
31-
dbal-version: "2.13"
3227
- php-version: "8.1"
3328
dbal-version: "3.2@dev"
3429

@@ -78,16 +73,12 @@ jobs:
7873
strategy:
7974
matrix:
8075
php-version:
81-
- "7.4"
76+
- "8.0"
8277
dbal-version:
8378
- "default"
8479
postgres-version:
8580
- "9.6"
8681
- "13"
87-
include:
88-
- php-version: "8.0"
89-
dbal-version: "2.13"
90-
postgres-version: "13"
9182

9283
services:
9384
postgres:
@@ -139,19 +130,14 @@ jobs:
139130
strategy:
140131
matrix:
141132
php-version:
142-
- "7.4"
133+
- "8.0"
143134
dbal-version:
144135
- "default"
145136
mariadb-version:
146137
- "10.5"
147138
extension:
148139
- "mysqli"
149140
- "pdo_mysql"
150-
include:
151-
- php-version: "8.0"
152-
dbal-version: "2.13"
153-
mariadb-version: "10.5"
154-
extension: "pdo_mysql"
155141

156142
services:
157143
mariadb:
@@ -205,7 +191,7 @@ jobs:
205191
strategy:
206192
matrix:
207193
php-version:
208-
- "7.4"
194+
- "8.0"
209195
dbal-version:
210196
- "default"
211197
mysql-version:
@@ -214,11 +200,6 @@ jobs:
214200
extension:
215201
- "mysqli"
216202
- "pdo_mysql"
217-
include:
218-
- php-version: "8.0"
219-
dbal-version: "2.13"
220-
mysql-version: "8.0"
221-
extension: "pdo_mysql"
222203

223204
services:
224205
mysql:
@@ -270,39 +251,6 @@ jobs:
270251
path: "coverage*.xml"
271252

272253

273-
phpunit-lower-php-versions:
274-
name: "PHPUnit with SQLite"
275-
runs-on: "ubuntu-20.04"
276-
277-
strategy:
278-
matrix:
279-
php-version:
280-
- "7.1"
281-
deps:
282-
- "highest"
283-
- "lowest"
284-
285-
steps:
286-
- name: "Checkout"
287-
uses: "actions/checkout@v2"
288-
with:
289-
fetch-depth: 2
290-
291-
- name: "Install PHP"
292-
uses: "shivammathur/setup-php@v2"
293-
with:
294-
php-version: "${{ matrix.php-version }}"
295-
ini-values: "zend.assertions=1"
296-
297-
- name: "Install dependencies with Composer"
298-
uses: "ramsey/composer-install@v1"
299-
with:
300-
dependency-versions: "${{ matrix.deps }}"
301-
302-
- name: "Run PHPUnit"
303-
run: "vendor/bin/phpunit -c ci/github/phpunit/sqlite.xml"
304-
305-
306254
upload_coverage:
307255
name: "Upload coverage to Codecov"
308256
runs-on: "ubuntu-20.04"

.github/workflows/phpbench.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
matrix:
2222
php-version:
23-
- "7.4"
23+
- "8.0"
2424

2525
steps:
2626
- name: "Checkout"

.github/workflows/static-analysis.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ jobs:
2121
- "8.1"
2222
dbal-version:
2323
- "default"
24-
- "2.13"
2524

2625
steps:
2726
- name: "Checkout code"
@@ -46,10 +45,6 @@ jobs:
4645
run: "vendor/bin/phpstan analyse"
4746
if: "${{ matrix.dbal-version == 'default' }}"
4847

49-
- name: "Run a static analysis with phpstan/phpstan"
50-
run: "vendor/bin/phpstan analyse -c phpstan-dbal2.neon"
51-
if: "${{ matrix.dbal-version == '2.13' }}"
52-
5348
static-analysis-psalm:
5449
name: "Static Analysis with Psalm"
5550
runs-on: "ubuntu-20.04"

UPGRADE.md

Lines changed: 138 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,132 @@
1+
# Upgrade to 3.0
2+
3+
## BC BREAK: Remove cache settings inspection
4+
5+
Doctrine does not provide its own cache implementation anymore and relies on
6+
the PSR-6 standard instead. As a consequence, we cannot determine anymore
7+
whether a given cache adapter is suitable for a production environment.
8+
Because of that, functionality that aims to do so has been removed:
9+
10+
* `Configuration::ensureProductionSettings()`
11+
* the `orm:ensure-production-settings` console command
12+
13+
## BC BREAK: PSR-6-based second level cache
14+
15+
The second level cache has been reworked to consume a PSR-6 cache. Using a
16+
Doctrine Cache instance is not supported anymore.
17+
18+
* `DefaultCacheFactory`: The constructor expects a PSR-6 cache item pool as
19+
second argument now.
20+
* `DefaultMultiGetRegion`: This class has been removed.
21+
* `DefaultRegion`:
22+
* The constructor expects a PSR-6 cache item pool as second argument now.
23+
* The protected `$cache` property is removed.
24+
* The properties `$name` and `$lifetime` as well as the constant
25+
`REGION_KEY_SEPARATOR` and the method `getCacheEntryKey()` are
26+
`private` now.
27+
* The method `getCache()` has been removed.
28+
29+
30+
## BC Break: Remove `Doctrine\ORM\Mapping\Driver\PHPDriver`
31+
32+
Use `StaticPHPDriver` instead when you want to programmatically configure
33+
entity metadata.
34+
35+
## BC BREAK: Remove `Doctrine\ORM\EntityManagerInterface#transactional()`
36+
37+
This method has been replaced by `Doctrine\ORM\EntityManagerInterface#wrapInTransaction()`.
38+
39+
## BC BREAK: Removed support for schema emulation.
40+
41+
The ORM no longer attempts to emulate schemas on SQLite.
42+
43+
## BC BREAK: Remove `Setup::registerAutoloadDirectory()`
44+
45+
Use Composer's autoloader instead.
46+
47+
## BC BREAK: Remove YAML mapping drivers.
48+
49+
If your code relies on `YamlDriver` or `SimpleYamlDriver`, you **MUST** migrate to
50+
attribute, annotation or XML drivers instead.
51+
52+
You can use the `orm:convert-mapping` command to convert your metadata mapping to XML
53+
_before_ upgrading to 3.0:
54+
55+
```sh
56+
php doctrine orm:convert-mapping xml /path/to/mapping-path-converted-to-xml
57+
```
58+
59+
## BC BREAK: Remove code generators and related console commands
60+
61+
These console commands have been removed:
62+
63+
* `orm:convert-d1-schema`
64+
* `orm:convert-mapping`
65+
* `orm:generate:entities`
66+
* `orm:generate-repositories`
67+
68+
These classes have been deprecated:
69+
70+
* `Doctrine\ORM\Tools\ConvertDoctrine1Schema`
71+
* `Doctrine\ORM\Tools\EntityGenerator`
72+
* `Doctrine\ORM\Tools\EntityRepositoryGenerator`
73+
74+
The entire `Doctrine\ORM\Tools\Export` namespace has been removed as well.
75+
76+
## BC BREAK: Removed `Doctrine\ORM\Version`
77+
78+
Use Composer's runtime API if you _really_ need to check the version of the ORM package at runtime.
79+
80+
## BC BREAK: EntityRepository::count() signature change
81+
82+
The argument `$criteria` of `Doctrine\ORM\EntityRepository::count()` is now
83+
optional. Overrides in child classes should be made compatible.
84+
85+
## BC BREAK: changes in exception hierarchy
86+
87+
- `Doctrine\ORM\ORMException` has been removed
88+
- `Doctrine\ORM\Exception\ORMException` is now an interface
89+
90+
## Variadic methods now use native variadics
91+
The following methods were using `func_get_args()` to simulate a variadic argument:
92+
- `Doctrine\ORM\Query\Expr#andX()`
93+
- `Doctrine\ORM\Query\Expr#orX()`
94+
- `Doctrine\ORM\QueryBuilder#select()`
95+
- `Doctrine\ORM\QueryBuilder#addSelect()`
96+
- `Doctrine\ORM\QueryBuilder#where()`
97+
- `Doctrine\ORM\QueryBuilder#andWhere()`
98+
- `Doctrine\ORM\QueryBuilder#orWhere()`
99+
- `Doctrine\ORM\QueryBuilder#groupBy()`
100+
- `Doctrine\ORM\QueryBuilder#andGroupBy()`
101+
- `Doctrine\ORM\QueryBuilder#having()`
102+
- `Doctrine\ORM\QueryBuilder#andHaving()`
103+
- `Doctrine\ORM\QueryBuilder#orHaving()`
104+
A variadic argument is now actually used in their signatures signature (`...$x`).
105+
Signatures of overridden methods should be changed accordingly
106+
107+
## Minor BC BREAK: removed `Doctrine\ORM\EntityManagerInterface#copy()`
108+
109+
Method `Doctrine\ORM\EntityManagerInterface#copy()` never got its implementation and is removed in 3.0.
110+
111+
## BC BREAK: Removed classes related to UUID and TABLE generator strategies
112+
113+
The following classes have been removed:
114+
- `Doctrine\ORM\Id\TableGenerator`
115+
- `Doctrine\ORM\Id\UuidGenerator`
116+
117+
Using the `UUID` strategy for generating identifiers is not supported anymore.
118+
119+
## BC BREAK: Removed `Query::iterate()`
120+
121+
The deprecated method `Query::iterate()` has been removed along with the
122+
following classes and methods:
123+
124+
- `AbstractHydrator::iterate()`
125+
- `AbstractHydrator::hydrateRow()`
126+
- `IterableResult`
127+
128+
Use `toIterable()` instead.
129+
1130
# Upgrade to 2.11
2131

3132
## Rename `AbstractIdGenerator::generate()` to `generateId()`
@@ -171,12 +300,12 @@ Note that `toIterable()` yields results of the query, unlike `iterate()` which y
171300

172301
# Upgrade to 2.7
173302

174-
## Added `Doctrine\ORM\AbstractQuery#enableResultCache()` and `Doctrine\ORM\AbstractQuery#disableResultCache()` methods
303+
## Added `Doctrine\ORM\AbstractQuery#enableResultCache()` and `Doctrine\ORM\AbstractQuery#disableResultCache()` methods
175304

176305
Method `Doctrine\ORM\AbstractQuery#useResultCache()` which could be used for both enabling and disabling the cache
177-
(depending on passed flag) was split into two.
306+
(depending on passed flag) was split into two.
178307

179-
## Minor BC BREAK: paginator output walkers aren't be called anymore on sub-queries for queries without max results
308+
## Minor BC BREAK: paginator output walkers aren't be called anymore on sub-queries for queries without max results
180309

181310
To optimize DB interaction, `Doctrine\ORM\Tools\Pagination\Paginator` no longer fetches identifiers to be able to
182311
perform the pagination with join collections when max results isn't set in the query.
@@ -195,7 +324,7 @@ In the last patch of the `v2.6.x` series, we fixed a bug that was not converting
195324
In order to not break BC we've introduced a way to enable the fixed behavior using a boolean constructor argument. This
196325
argument will be removed in 3.0 and the default behavior will be the fixed one.
197326

198-
## Deprecated: `Doctrine\ORM\AbstractQuery#useResultCache()`
327+
## Deprecated: `Doctrine\ORM\AbstractQuery#useResultCache()`
199328

200329
Method `Doctrine\ORM\AbstractQuery#useResultCache()` is deprecated because it is split into `enableResultCache()`
201330
and `disableResultCache()`. It will be removed in 3.0.
@@ -225,7 +354,7 @@ These related classes have been deprecated:
225354

226355
* `Doctrine\ORM\Proxy\ProxyFactory`
227356
* `Doctrine\ORM\Proxy\Autoloader` - we suggest using the composer autoloader instead
228-
357+
229358
These methods have been deprecated:
230359

231360
* `Doctrine\ORM\Configuration#getAutoGenerateProxyClasses()`
@@ -274,7 +403,7 @@ If your code relies on single entity flushing optimisations via
274403

275404
Said API was affected by multiple data integrity bugs due to the fact
276405
that change tracking was being restricted upon a subset of the managed
277-
entities. The ORM cannot support committing subsets of the managed
406+
entities. The ORM cannot support committing subsets of the managed
278407
entities while also guaranteeing data integrity, therefore this
279408
utility was removed.
280409

@@ -375,8 +504,8 @@ either:
375504
- map those classes as `MappedSuperclass`
376505

377506
## Minor BC BREAK: ``EntityManagerInterface`` instead of ``EntityManager`` in type-hints
378-
379-
As of 2.5, classes requiring the ``EntityManager`` in any method signature will now require
507+
508+
As of 2.5, classes requiring the ``EntityManager`` in any method signature will now require
380509
an ``EntityManagerInterface`` instead.
381510
If you are extending any of the following classes, then you need to check following
382511
signatures:
@@ -469,7 +598,7 @@ the `Doctrine\ORM\Repository\DefaultRepositoryFactory`.
469598
When executing DQL queries with new object expressions, instead of returning DTOs numerically indexes, it will now respect user provided aliases. Consider the following query:
470599

471600
SELECT new UserDTO(u.id,u.name) as user,new AddressDTO(a.street,a.postalCode) as address, a.id as addressId FROM User u INNER JOIN u.addresses a WITH a.isPrimary = true
472-
601+
473602
Previously, your result would be similar to this:
474603

475604
array(

composer.json

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,42 +20,38 @@
2020
"sort-packages": true
2121
},
2222
"require": {
23-
"php": "^7.1 || ^8.0",
23+
"php": "^8.0",
2424
"composer-runtime-api": "^2",
2525
"ext-ctype": "*",
2626
"ext-pdo": "*",
2727
"doctrine/cache": "^1.12.1 || ^2.1.1",
2828
"doctrine/collections": "^1.5",
2929
"doctrine/common": "^3.0.3",
30-
"doctrine/dbal": "^2.13.1 || ^3.2",
30+
"doctrine/dbal": "^3.3@dev",
3131
"doctrine/deprecations": "^0.5.3",
3232
"doctrine/event-manager": "^1.1",
3333
"doctrine/inflector": "^1.4 || ^2.0",
3434
"doctrine/instantiator": "^1.3",
3535
"doctrine/lexer": "^1.0",
3636
"doctrine/persistence": "^2.2",
3737
"psr/cache": "^1 || ^2 || ^3",
38-
"symfony/console": "^3.0 || ^4.0 || ^5.0 || ^6.0",
39-
"symfony/polyfill-php72": "^1.23",
40-
"symfony/polyfill-php80": "^1.15"
38+
"symfony/console": "^3.0 || ^4.0 || ^5.0 || ^6.0"
4139
},
4240
"require-dev": {
4341
"doctrine/annotations": "^1.13",
4442
"doctrine/coding-standard": "^9.0",
45-
"phpbench/phpbench": "^0.16.10 || ^1.0",
43+
"phpbench/phpbench": "^1.0",
4644
"phpstan/phpstan": "1.3.3",
47-
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.4",
45+
"phpunit/phpunit": "^9.5",
4846
"squizlabs/php_codesniffer": "3.6.2",
4947
"symfony/cache": "^4.4 || ^5.4 || ^6.0",
50-
"symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0",
5148
"vimeo/psalm": "4.18.1"
5249
},
5350
"conflict": {
5451
"doctrine/annotations": "<1.13 || >= 2.0"
5552
},
5653
"suggest": {
57-
"symfony/cache": "Provides cache support for Setup Tool with doctrine/cache 2.0",
58-
"symfony/yaml": "If you want to use YAML Metadata Mapping Driver"
54+
"symfony/cache": "Provides cache support for Setup Tool with doctrine/cache 2.0"
5955
},
6056
"autoload": {
6157
"psr-4": { "Doctrine\\ORM\\": "lib/Doctrine/ORM" }

docs/en/_exts/configurationblock.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class ConfigurationBlock(Directive):
3535
'html': 'HTML',
3636
'xml': 'XML',
3737
'php': 'PHP',
38-
'yaml': 'YAML',
3938
'jinja': 'Twig',
4039
'html+jinja': 'Twig',
4140
'jinja+html': 'Twig',

0 commit comments

Comments
 (0)