Skip to content

Commit 528b883

Browse files
authored
Merge pull request doctrine#11929 from doctrine/2.20.x-merge-up-into-2.21.x_KkdqS0u7
Merge release 2.20.3 into 2.21.x
2 parents 73e68f3 + 17d28b5 commit 528b883

36 files changed

+373
-91
lines changed

.github/workflows/coding-standards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ on:
2424

2525
jobs:
2626
coding-standards:
27-
uses: "doctrine/.github/.github/workflows/[email protected].1"
27+
uses: "doctrine/.github/.github/workflows/[email protected].2"

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ on:
1717
jobs:
1818
documentation:
1919
name: "Documentation"
20-
uses: "doctrine/.github/.github/workflows/[email protected].1"
20+
uses: "doctrine/.github/.github/workflows/[email protected].2"

.github/workflows/release-on-milestone-closed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
release:
10-
uses: "doctrine/.github/.github/workflows/[email protected].1"
10+
uses: "doctrine/.github/.github/workflows/[email protected].2"
1111
secrets:
1212
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
1313
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@
4141
},
4242
"require-dev": {
4343
"doctrine/annotations": "^1.13 || ^2",
44-
"doctrine/coding-standard": "^9.0.2 || ^12.0",
44+
"doctrine/coding-standard": "^9.0.2 || ^13.0",
4545
"phpbench/phpbench": "^0.16.10 || ^1.0",
4646
"phpstan/extension-installer": "~1.1.0 || ^1.4",
4747
"phpstan/phpstan": "~1.4.10 || 2.0.3",
4848
"phpstan/phpstan-deprecation-rules": "^1 || ^2",
4949
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.6",
5050
"psr/log": "^1 || ^2 || ^3",
51-
"squizlabs/php_codesniffer": "3.7.2",
51+
"squizlabs/php_codesniffer": "3.12.0",
5252
"symfony/cache": "^4.4 || ^5.4 || ^6.4 || ^7.0",
5353
"symfony/var-exporter": "^4.4 || ^5.4 || ^6.2 || ^7.0",
5454
"symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0"

docs/en/reference/advanced-configuration.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ Configuration Options
7171
The following sections describe all the configuration options
7272
available on a ``Doctrine\ORM\Configuration`` instance.
7373

74-
Proxy Directory (***REQUIRED***)
75-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
74+
Proxy Directory (**REQUIRED**)
75+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7676

7777
.. code-block:: php
7878
@@ -85,8 +85,8 @@ classes. For a detailed explanation on proxy classes and how they
8585
are used in Doctrine, refer to the "Proxy Objects" section further
8686
down.
8787

88-
Proxy Namespace (***REQUIRED***)
89-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
88+
Proxy Namespace (**REQUIRED**)
89+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9090

9191
.. code-block:: php
9292
@@ -98,8 +98,8 @@ Gets or sets the namespace to use for generated proxy classes. For
9898
a detailed explanation on proxy classes and how they are used in
9999
Doctrine, refer to the "Proxy Objects" section further down.
100100

101-
Metadata Driver (***REQUIRED***)
102-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101+
Metadata Driver (**REQUIRED**)
102+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
103103

104104
.. code-block:: php
105105
@@ -144,8 +144,8 @@ accept either a single directory as a string or an array of
144144
directories. With this feature a single driver can support multiple
145145
directories of Entities.
146146

147-
Metadata Cache (***RECOMMENDED***)
148-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
147+
Metadata Cache (**RECOMMENDED**)
148+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
149149

150150
.. code-block:: php
151151
@@ -166,8 +166,8 @@ For development you should use an array cache like
166166
``Symfony\Component\Cache\Adapter\ArrayAdapter``
167167
which only caches data on a per-request basis.
168168

169-
Query Cache (***RECOMMENDED***)
170-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
169+
Query Cache (**RECOMMENDED**)
170+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
171171

172172
.. code-block:: php
173173
@@ -189,8 +189,8 @@ For development you should use an array cache like
189189
``Symfony\Component\Cache\Adapter\ArrayAdapter``
190190
which only caches data on a per-request basis.
191191

192-
SQL Logger (***Optional***)
193-
~~~~~~~~~~~~~~~~~~~~~~~~~~~
192+
SQL Logger (**Optional**)
193+
~~~~~~~~~~~~~~~~~~~~~~~~~
194194

195195
.. code-block:: php
196196
@@ -202,8 +202,8 @@ Gets or sets the logger to use for logging all SQL statements
202202
executed by Doctrine. The logger class must implement the
203203
deprecated ``Doctrine\DBAL\Logging\SQLLogger`` interface.
204204

205-
Auto-generating Proxy Classes (***OPTIONAL***)
206-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
205+
Auto-generating Proxy Classes (**OPTIONAL**)
206+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
207207

208208
Proxy classes can either be generated manually through the Doctrine
209209
Console or automatically at runtime by Doctrine. The configuration
@@ -446,7 +446,7 @@ correctly if sub-namespaces use different metadata driver
446446
implementations.
447447

448448

449-
Default Repository (***OPTIONAL***)
449+
Default Repository (**OPTIONAL**)
450450
-----------------------------------
451451

452452
Specifies the FQCN of a subclass of the EntityRepository.
@@ -461,7 +461,7 @@ That will be available for all entities without a custom repository class.
461461
The default value is ``Doctrine\ORM\EntityRepository``.
462462
Any repository class must be a subclass of EntityRepository otherwise you got an ORMException
463463

464-
Ignoring entities (***OPTIONAL***)
464+
Ignoring entities (**OPTIONAL**)
465465
-----------------------------------
466466

467467
Specifies the Entity FQCNs to ignore.

docs/en/reference/association-mapping.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1426,7 +1426,7 @@ Is essentially the same as following:
14261426
<doctrine-mapping>
14271427
<entity class="Product">
14281428
<one-to-one field="shipment" target-entity="Shipment">
1429-
<join-column name="shipment_id" referenced-column-name="id" nulable=false />
1429+
<join-column name="shipment_id" referenced-column-name="id" nullable=false />
14301430
</one-to-one>
14311431
</entity>
14321432
</doctrine-mapping>

docs/en/reference/events.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ specific to a particular entity class's lifecycle.
299299
<?xml version="1.0" encoding="UTF-8"?>
300300
301301
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
302-
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
302+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
303303
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
304304
https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
305305
<entity name="User">

docs/en/reference/second-level-cache.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ level cache region.
323323
324324
<?xml version="1.0" encoding="utf-8"?>
325325
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
326-
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
326+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
327327
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
328328
https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
329329
<entity name="Country">
@@ -431,7 +431,7 @@ It caches the primary keys of association and cache each element will be cached
431431
432432
<?xml version="1.0" encoding="utf-8"?>
433433
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
434-
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
434+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
435435
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
436436
https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
437437
<entity name="State">

docs/en/reference/working-with-associations.rst

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,35 @@ methods:
736736

737737
.. note::
738738

739-
There is a limitation on the compatibility of Criteria comparisons.
740-
You have to use scalar values only as the value in a comparison or
741-
the behaviour between different backends is not the same.
739+
Depending on whether the collection has already been loaded from the
740+
database or not, criteria matching may happen at the database/SQL level
741+
or on objects in memory. This may lead to different results and come
742+
surprising, for example when a code change in one place leads to a collection
743+
becoming initialized and, as a side effect, returning a different result
744+
or even breaking a ``matching()`` call somewhere else. Also, collection
745+
initialization state in practical use cases may differ from the one covered
746+
in unit tests.
747+
748+
Database level comparisons are based on scalar representations of the values
749+
stored in entity properties. The field names passed to expressions correspond
750+
to property names. Comparison and sorting may be affected by
751+
database-specific behavior. For example, MySQL enum types sort by index position,
752+
not lexicographically by value.
753+
754+
In-memory handling is based on the ``Selectable`` API of `Doctrine Collections <https://www.doctrine-project.org/projects/doctrine-collections/en/stable/index.html#matching>`.
755+
In this case, field names passed to expressions are being used to derive accessor
756+
method names. Strict type comparisons are used for equal and not-equal checks,
757+
and generally PHP language rules are being used for other comparison operators
758+
or sorting.
759+
760+
As a general guidance, for consistent results use the Criteria API with scalar
761+
values only. Note that ``DateTime`` and ``DateTimeImmutable`` are two predominant
762+
examples of value objects that are *not* scalars.
763+
764+
Refrain from using special database-level column types or custom Doctrine Types
765+
that may lead to database-specific comparison or sorting rules being applied, or
766+
to database-level values being different from object field values.
767+
768+
Provide accessor methods for all entity fields used in criteria expressions,
769+
and implement those methods in a way that their return value is the
770+
same as the database-level value.

docs/en/reference/xml-mapping.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ setup for the latest code in trunk.
1717
.. code-block:: xml
1818
1919
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
20-
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
20+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2121
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
2222
https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
2323
@@ -103,7 +103,7 @@ of several common elements:
103103
// Doctrine.Tests.ORM.Mapping.User.dcm.xml
104104
<?xml version="1.0" encoding="UTF-8"?>
105105
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
106-
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
106+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
107107
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
108108
https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
109109
@@ -770,7 +770,7 @@ entity relationship. You can define this in XML with the "association-key" attri
770770
.. code-block:: xml
771771
772772
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
773-
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
773+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
774774
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
775775
https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
776776

0 commit comments

Comments
 (0)