Skip to content

Commit 47f931c

Browse files
committed
Merge branch '2.11.x' into 3.0.x
* 2.11.x: Enable UnusedUse sniff again (doctrine#9267) Whitelist composer plugins used by this repository (doctrine#9286) Fix XML export for `change-tracking-policy` (doctrine#9285) Allow symfony/cache 6 (doctrine#9283) Put actual value instead of index inside $originalEntityData. (doctrine#9244) Fix return types of cache interfaces (doctrine#9271) Better explain limitations of DQL "DELETE" (doctrine#9281) Fix docblocks on nullable EM properties (doctrine#9273) Docs: use canonical order for phpdoc tags, add missed semicolon (doctrine#9190) Make PrimaryReadReplicaConnection enforcement explicit (doctrine#9239) Regenerate Psalm baseline (doctrine#9272) Improve compatibility with Doctrine DBAL 4 (doctrine#9266) [docs] Fix wording for attributes=>parameters. (doctrine#9265) Support for nesting attributes with PHP 8.1 (doctrine#9241) Revert "Fix SchemaValidator with abstract child class in discriminator map (doctrine#9096)" (doctrine#9262) Docs: consistency for FQCN, spacing, etc (doctrine#9232)
2 parents 61e2caf + f1483f8 commit 47f931c

File tree

276 files changed

+1102
-778
lines changed

Some content is hidden

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

276 files changed

+1102
-778
lines changed

composer.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
{"name": "Marco Pivetta", "email": "ocramius@gmail.com"}
1414
],
1515
"config": {
16+
"allow-plugins": {
17+
"composer/package-versions-deprecated": true,
18+
"dealerdirect/phpcodesniffer-composer-installer": true
19+
},
1620
"sort-packages": true
1721
},
1822
"require": {
@@ -41,7 +45,7 @@
4145
"phpstan/phpstan": "1.2.0",
4246
"phpunit/phpunit": "^9.5",
4347
"squizlabs/php_codesniffer": "3.6.2",
44-
"symfony/cache": "^4.4 || ^5.2",
48+
"symfony/cache": "^4.4 || ^5.4 || ^6.0",
4549
"vimeo/psalm": "4.15.0"
4650
},
4751
"conflict": {

docs/en/cookbook/advanced-field-value-conversion-using-custom-mapping-types.rst

+11-11
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Advanced field value conversion using custom mapping types
44
.. sectionauthor:: Jan Sorgalla <jsorgalla@googlemail.com>
55

66
When creating entities, you sometimes have the need to transform field values
7-
before they are saved to the database. In Doctrine you can use Custom Mapping
7+
before they are saved to the database. In Doctrine you can use Custom Mapping
88
Types to solve this (see: :ref:`reference-basic-mapping-custom-mapping-types`).
99

1010
There are several ways to achieve this: converting the value inside the Type
@@ -15,7 +15,7 @@ type `Point <https://dev.mysql.com/doc/refman/8.0/en/gis-class-point.html>`_.
1515

1616
The ``Point`` type is part of the `Spatial extension <https://dev.mysql.com/doc/refman/8.0/en/spatial-extensions.html>`_
1717
of MySQL and enables you to store a single location in a coordinate space by
18-
using x and y coordinates. You can use the Point type to store a
18+
using x and y coordinates. You can use the Point type to store a
1919
longitude/latitude pair to represent a geographic location.
2020

2121
The entity
@@ -29,9 +29,9 @@ The entity class:
2929
.. code-block:: php
3030
3131
<?php
32-
32+
3333
namespace Geo\Entity;
34-
34+
3535
/**
3636
* @Entity
3737
*/
@@ -84,15 +84,15 @@ The entity class:
8484
}
8585
}
8686
87-
We use the custom type ``point`` in the ``@Column`` docblock annotation of the
87+
We use the custom type ``point`` in the ``@Column`` docblock annotation of the
8888
``$point`` field. We will create this custom mapping type in the next chapter.
8989

9090
The point class:
9191

9292
.. code-block:: php
9393
9494
<?php
95-
95+
9696
namespace Geo\ValueObject;
9797
9898
class Point
@@ -196,7 +196,7 @@ The format of the string representation format is called
196196
`Well-known text (WKT) <https://en.wikipedia.org/wiki/Well-known_text>`_.
197197
The advantage of this format is, that it is both human readable and parsable by MySQL.
198198

199-
Internally, MySQL stores geometry values in a binary format that is not
199+
Internally, MySQL stores geometry values in a binary format that is not
200200
identical to the WKT format. So, we need to let MySQL transform the WKT
201201
representation into its internal format.
202202

@@ -210,13 +210,13 @@ which convert WKT strings to and from the internal format of MySQL.
210210

211211
.. note::
212212

213-
When using DQL queries, the ``convertToPHPValueSQL`` and
213+
When using DQL queries, the ``convertToPHPValueSQL`` and
214214
``convertToDatabaseValueSQL`` methods only apply to identification variables
215-
and path expressions in SELECT clauses. Expressions in WHERE clauses are
215+
and path expressions in SELECT clauses. Expressions in WHERE clauses are
216216
**not** wrapped!
217217

218218
If you want to use Point values in WHERE clauses, you have to implement a
219-
:doc:`user defined function <dql-user-defined-functions>` for
219+
:doc:`user defined function <dql-user-defined-functions>` for
220220
``PointFromText``.
221221

222222
Example usage
@@ -252,5 +252,5 @@ Example usage
252252
$query = $em->createQuery("SELECT l FROM Geo\Entity\Location l WHERE l.address = '1600 Amphitheatre Parkway, Mountain View, CA'");
253253
$location = $query->getSingleResult();
254254
255-
/* @var Geo\ValueObject\Point */
255+
/** @var Geo\ValueObject\Point */
256256
$point = $location->getPoint();

docs/en/cookbook/dql-custom-walkers.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ API would look for this use-case:
8888
$pageNum = 1;
8989
$query = $em->createQuery($dql);
9090
$query->setFirstResult( ($pageNum-1) * 20)->setMaxResults(20);
91-
91+
9292
$totalResults = Paginate::count($query);
9393
$results = $query->getResult();
9494
@@ -101,12 +101,12 @@ The ``Paginate::count(Query $query)`` looks like:
101101
{
102102
static public function count(Query $query)
103103
{
104-
/* @var $countQuery Query */
104+
/** @var Query $countQuery */
105105
$countQuery = clone $query;
106-
106+
107107
$countQuery->setHint(Query::HINT_CUSTOM_TREE_WALKERS, array('DoctrineExtensions\Paginate\CountSqlWalker'));
108108
$countQuery->setFirstResult(null)->setMaxResults(null);
109-
109+
110110
return $countQuery->getSingleScalarResult();
111111
}
112112
}
@@ -137,13 +137,13 @@ implementation is:
137137
break;
138138
}
139139
}
140-
140+
141141
$pathExpression = new PathExpression(
142142
PathExpression::TYPE_STATE_FIELD | PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION, $parentName,
143143
$parent['metadata']->getSingleIdentifierFieldName()
144144
);
145145
$pathExpression->type = PathExpression::TYPE_STATE_FIELD;
146-
146+
147147
$AST->selectClause->selectExpressions = array(
148148
new SelectExpression(
149149
new AggregateExpression('count', $pathExpression, true), null
@@ -196,15 +196,15 @@ modify the generation of the SELECT clause, adding the
196196
public function walkSelectClause($selectClause)
197197
{
198198
$sql = parent::walkSelectClause($selectClause);
199-
199+
200200
if ($this->getQuery()->getHint('mysqlWalker.sqlNoCache') === true) {
201201
if ($selectClause->isDistinct) {
202202
$sql = str_replace('SELECT DISTINCT', 'SELECT DISTINCT SQL_NO_CACHE', $sql);
203203
} else {
204204
$sql = str_replace('SELECT', 'SELECT SQL_NO_CACHE', $sql);
205205
}
206206
}
207-
207+
208208
return $sql;
209209
}
210210
}

docs/en/cookbook/dql-user-defined-functions.rst

+12-12
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ configuration:
4545
$config->addCustomStringFunction($name, $class);
4646
$config->addCustomNumericFunction($name, $class);
4747
$config->addCustomDatetimeFunction($name, $class);
48-
48+
4949
$em = EntityManager::create($dbParams, $config);
5050
5151
The ``$name`` is the name the function will be referred to in the
@@ -96,7 +96,7 @@ discuss it step by step:
9696
// (1)
9797
public $firstDateExpression = null;
9898
public $secondDateExpression = null;
99-
99+
100100
public function parse(\Doctrine\ORM\Query\Parser $parser)
101101
{
102102
$parser->match(Lexer::T_IDENTIFIER); // (2)
@@ -106,7 +106,7 @@ discuss it step by step:
106106
$this->secondDateExpression = $parser->ArithmeticPrimary(); // (6)
107107
$parser->match(Lexer::T_CLOSE_PARENTHESIS); // (3)
108108
}
109-
109+
110110
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
111111
{
112112
return 'DATEDIFF(' .
@@ -180,28 +180,28 @@ I'll skip the blah and show the code for this function:
180180
public $firstDateExpression = null;
181181
public $intervalExpression = null;
182182
public $unit = null;
183-
183+
184184
public function parse(\Doctrine\ORM\Query\Parser $parser)
185185
{
186186
$parser->match(Lexer::T_IDENTIFIER);
187187
$parser->match(Lexer::T_OPEN_PARENTHESIS);
188-
188+
189189
$this->firstDateExpression = $parser->ArithmeticPrimary();
190-
190+
191191
$parser->match(Lexer::T_COMMA);
192192
$parser->match(Lexer::T_IDENTIFIER);
193-
193+
194194
$this->intervalExpression = $parser->ArithmeticPrimary();
195-
195+
196196
$parser->match(Lexer::T_IDENTIFIER);
197-
198-
/* @var $lexer Lexer */
197+
198+
/** @var Lexer $lexer */
199199
$lexer = $parser->getLexer();
200200
$this->unit = $lexer->token['value'];
201-
201+
202202
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
203203
}
204-
204+
205205
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
206206
{
207207
return 'DATE_ADD(' .

0 commit comments

Comments
 (0)