Skip to content

Commit 10a32cb

Browse files
committed
Merge remote-tracking branch 'origin/2.20.x' into 3.3.x
2 parents d883713 + c679d1b commit 10a32cb

9 files changed

+31
-35
lines changed

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@
3737
"symfony/var-exporter": "^6.3.9 || ^7.0"
3838
},
3939
"require-dev": {
40-
"doctrine/coding-standard": "^12.0",
40+
"doctrine/coding-standard": "^13.0",
4141
"phpbench/phpbench": "^1.0",
4242
"phpdocumentor/guides-cli": "^1.4",
4343
"phpstan/extension-installer": "^1.4",
4444
"phpstan/phpstan": "2.0.3",
4545
"phpstan/phpstan-deprecation-rules": "^2",
4646
"phpunit/phpunit": "^10.4.0",
4747
"psr/log": "^1 || ^2 || ^3",
48-
"squizlabs/php_codesniffer": "3.7.2",
48+
"squizlabs/php_codesniffer": "3.12.0",
4949
"symfony/cache": "^5.4 || ^6.2 || ^7.0"
5050
},
5151
"suggest": {

docs/en/reference/advanced-configuration.rst

+16-16
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
@@ -139,8 +139,8 @@ accept either a single directory as a string or an array of
139139
directories. With this feature a single driver can support multiple
140140
directories of Entities.
141141

142-
Metadata Cache (***RECOMMENDED***)
143-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
142+
Metadata Cache (**RECOMMENDED**)
143+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
144144

145145
.. code-block:: php
146146
@@ -161,8 +161,8 @@ For development you should use an array cache like
161161
``Symfony\Component\Cache\Adapter\ArrayAdapter``
162162
which only caches data on a per-request basis.
163163

164-
Query Cache (***RECOMMENDED***)
165-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
164+
Query Cache (**RECOMMENDED**)
165+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
166166

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

187-
SQL Logger (***Optional***)
188-
~~~~~~~~~~~~~~~~~~~~~~~~~~~
187+
SQL Logger (**Optional**)
188+
~~~~~~~~~~~~~~~~~~~~~~~~~
189189

190190
.. code-block:: php
191191
@@ -197,8 +197,8 @@ Gets or sets the logger to use for logging all SQL statements
197197
executed by Doctrine. The logger class must implement the
198198
deprecated ``Doctrine\DBAL\Logging\SQLLogger`` interface.
199199

200-
Auto-generating Proxy Classes (***OPTIONAL***)
201-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
200+
Auto-generating Proxy Classes (**OPTIONAL**)
201+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
202202

203203
Proxy classes can either be generated manually through the Doctrine
204204
Console or automatically at runtime by Doctrine. The configuration
@@ -441,7 +441,7 @@ correctly if sub-namespaces use different metadata driver
441441
implementations.
442442

443443

444-
Default Repository (***OPTIONAL***)
444+
Default Repository (**OPTIONAL**)
445445
-----------------------------------
446446

447447
Specifies the FQCN of a subclass of the EntityRepository.
@@ -456,7 +456,7 @@ That will be available for all entities without a custom repository class.
456456
The default value is ``Doctrine\ORM\EntityRepository``.
457457
Any repository class must be a subclass of EntityRepository otherwise you got an ORMException
458458

459-
Ignoring entities (***OPTIONAL***)
459+
Ignoring entities (**OPTIONAL**)
460460
-----------------------------------
461461

462462
Specifies the Entity FQCNs to ignore.

src/AbstractQuery.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ public function getParameter(int|string $key): Parameter|null
286286
$key = Parameter::normalizeName($key);
287287

288288
$filteredParameters = $this->parameters->filter(
289-
static fn (Parameter $parameter): bool => $parameter->getName() === $key
289+
static fn (Parameter $parameter): bool => $parameter->getName() === $key,
290290
);
291291

292292
return ! $filteredParameters->isEmpty() ? $filteredParameters->first() : null;

src/ORMInvalidArgumentException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ private static function newEntityFoundThroughRelationshipMessage(AssociationMapp
185185
. ' configured to cascade persist operations for entity: ' . self::objToStr($entity) . '.'
186186
. ' To solve this issue: Either explicitly call EntityManager#persist()'
187187
. ' on this unknown entity or configure cascade persist'
188-
. ' this association in the mapping for example @ManyToOne(..,cascade={"persist"}).'
188+
. ' this association in the mapping for example #[ORM\ManyToOne(..., cascade: [\'persist\'])].'
189189
. ($entity instanceof Stringable
190190
? ''
191191
: ' If you cannot find out which entity causes the problem implement \''

src/QueryBuilder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ public function getParameter(string|int $key): Parameter|null
504504
$key = Parameter::normalizeName($key);
505505

506506
$filteredParameters = $this->parameters->filter(
507-
static fn (Parameter $parameter): bool => $key === $parameter->getName()
507+
static fn (Parameter $parameter): bool => $key === $parameter->getName(),
508508
);
509509

510510
return ! $filteredParameters->isEmpty() ? $filteredParameters->first() : null;

src/Tools/Console/Command/MappingDescribeCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ private function getClassMetadata(
162162

163163
$matches = array_filter(
164164
$this->getMappedEntities($entityManager),
165-
static fn ($mappedEntity) => preg_match('{' . preg_quote($entityName) . '}', $mappedEntity)
165+
static fn ($mappedEntity) => preg_match('{' . preg_quote($entityName) . '}', $mappedEntity),
166166
);
167167

168168
if (! $matches) {

src/UnitOfWork.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -2024,7 +2024,7 @@ private function cascadeRefresh(object $entity, array &$visited, LockMode|int|nu
20242024

20252025
$associationMappings = array_filter(
20262026
$class->associationMappings,
2027-
static fn (AssociationMapping $assoc): bool => $assoc->isCascadeRefresh()
2027+
static fn (AssociationMapping $assoc): bool => $assoc->isCascadeRefresh(),
20282028
);
20292029

20302030
foreach ($associationMappings as $assoc) {
@@ -2065,7 +2065,7 @@ private function cascadeDetach(object $entity, array &$visited): void
20652065

20662066
$associationMappings = array_filter(
20672067
$class->associationMappings,
2068-
static fn (AssociationMapping $assoc): bool => $assoc->isCascadeDetach()
2068+
static fn (AssociationMapping $assoc): bool => $assoc->isCascadeDetach(),
20692069
);
20702070

20712071
foreach ($associationMappings as $assoc) {
@@ -2111,7 +2111,7 @@ private function cascadePersist(object $entity, array &$visited): void
21112111

21122112
$associationMappings = array_filter(
21132113
$class->associationMappings,
2114-
static fn (AssociationMapping $assoc): bool => $assoc->isCascadePersist()
2114+
static fn (AssociationMapping $assoc): bool => $assoc->isCascadePersist(),
21152115
);
21162116

21172117
foreach ($associationMappings as $assoc) {
@@ -2168,7 +2168,7 @@ private function cascadeRemove(object $entity, array &$visited): void
21682168

21692169
$associationMappings = array_filter(
21702170
$class->associationMappings,
2171-
static fn (AssociationMapping $assoc): bool => $assoc->isCascadeRemove()
2171+
static fn (AssociationMapping $assoc): bool => $assoc->isCascadeRemove(),
21722172
);
21732173

21742174
if ($associationMappings) {

tests/Tests/ORM/ORMInvalidArgumentExceptionTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function __toString(): string
7575
. 'persist operations for entity: stdClass@' . spl_object_id($entity1)
7676
. '. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity '
7777
. 'or configure cascade persist this association in the mapping for example '
78-
. '@ManyToOne(..,cascade={"persist"}). If you cannot find out which entity causes the problem '
78+
. '#[ORM\ManyToOne(..., cascade: [\'persist\'])]. If you cannot find out which entity causes the problem '
7979
. 'implement \'baz1#__toString()\' to get a clue.',
8080
],
8181
'two entities found' => [
@@ -94,13 +94,13 @@ public function __toString(): string
9494
. 'cascade persist operations for entity: stdClass@' . spl_object_id($entity1) . '. '
9595
. 'To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity '
9696
. 'or configure cascade persist this association in the mapping for example '
97-
. '@ManyToOne(..,cascade={"persist"}). If you cannot find out which entity causes the problem '
97+
. '#[ORM\ManyToOne(..., cascade: [\'persist\'])]. If you cannot find out which entity causes the problem '
9898
. 'implement \'baz1#__toString()\' to get a clue.' . "\n"
9999
. ' * A new entity was found through the relationship \'foo2#bar2\' that was not configured to '
100100
. 'cascade persist operations for entity: stdClass@' . spl_object_id($entity2) . '. To solve '
101101
. 'this issue: Either explicitly call EntityManager#persist() on this unknown entity or '
102102
. 'configure cascade persist this association in the mapping for example '
103-
. '@ManyToOne(..,cascade={"persist"}). If you cannot find out which entity causes the problem '
103+
. '#[ORM\ManyToOne(..., cascade: [\'persist\'])]. If you cannot find out which entity causes the problem '
104104
. 'implement \'baz2#__toString()\' to get a clue.',
105105
],
106106
'two entities found, one is stringable' => [
@@ -114,7 +114,7 @@ public function __toString(): string
114114
. 'persist operations for entity: ThisIsAStringRepresentationOfEntity3'
115115
. '. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity '
116116
. 'or configure cascade persist this association in the mapping for example '
117-
. '@ManyToOne(..,cascade={"persist"}).',
117+
. '#[ORM\ManyToOne(..., cascade: [\'persist\'])].',
118118
],
119119
];
120120
}

tests/Tests/OrmFunctionalTestCase.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -815,11 +815,7 @@ protected function tearDown(): void
815815
$this->_em->clear();
816816
}
817817

818-
/**
819-
* @param array $classNames
820-
*
821-
* @throws RuntimeException
822-
*/
818+
/** @throws RuntimeException */
823819
protected function setUpEntitySchema(array $classNames): void
824820
{
825821
if ($this->_em === null) {

0 commit comments

Comments
 (0)