Skip to content

Commit bc5efd4

Browse files
committed
Merge branch '2.18.x' into 3.0.x
* 2.18.x: Fix Static Analysis folder reference (#11281) docs: recommend safer way to disable logging (#11269) Remove unused baseline entries Treat '0' as a legitimate trim char
2 parents b6b4cbc + 0efac09 commit bc5efd4

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

.github/workflows/static-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- src/**
1111
- phpstan*
1212
- psalm*
13-
- tests/Doctrine/StaticAnalysis/**
13+
- tests/StaticAnalysis/**
1414
push:
1515
branches:
1616
- "*.x"
@@ -20,7 +20,7 @@ on:
2020
- src/**
2121
- phpstan*
2222
- psalm*
23-
- tests/Doctrine/StaticAnalysis/**
23+
- tests/StaticAnalysis/**
2424

2525
jobs:
2626
static-analysis-phpstan:

docs/en/reference/batch-processing.rst

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,20 @@ especially what the strategies presented here provide help with.
1818

1919
.. note::
2020

21-
Having an SQL logger enabled when processing batches can have a serious impact on performance and resource usage.
22-
To avoid that you should remove the corresponding middleware.
23-
To remove all middlewares, you can use this line:
21+
Having an SQL logger enabled when processing batches can have a
22+
serious impact on performance and resource usage.
23+
To avoid that, you should use a PSR logger implementation that can be
24+
disabled at runtime.
25+
For example, with Monolog, you can use ``Logger::pushHandler()``
26+
to push a ``NullHandler`` to the logger instance, and then pop it
27+
when you need to enable logging again.
28+
29+
With DBAL 2, you can disable the SQL logger like below:
30+
2431
.. code-block:: php
2532
2633
<?php
27-
$em->getConnection()->getConfiguration()->setMiddlewares([]); // DBAL 3
28-
$em->getConnection()->getConfiguration()->setSQLLogger(null); // DBAL 2
34+
$em->getConnection()->getConfiguration()->setSQLLogger(null);
2935
3036
Bulk Inserts
3137
------------
@@ -188,6 +194,3 @@ problems using the following approach:
188194
Iterating results is not possible with queries that
189195
fetch-join a collection-valued association. The nature of such SQL
190196
result sets is not suitable for incremental hydration.
191-
192-
193-

src/Query/AST/Functions/TrimFunction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function parse(Parser $parser): void
5959
$this->trimChar = $lexer->token->value;
6060
}
6161

62-
if ($this->leading || $this->trailing || $this->both || $this->trimChar) {
62+
if ($this->leading || $this->trailing || $this->both || ($this->trimChar !== false)) {
6363
$parser->match(TokenType::T_FROM);
6464
}
6565

tests/Tests/ORM/Query/LanguageRecognitionTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ public function testFunctionalExpressionsSupportedInWherePart(): void
162162
$this->assertValidDQL("SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE TRIM(u.name) = 'someone'");
163163
}
164164

165+
public function testTrimFalsyString(): void
166+
{
167+
$this->assertValidDQL("SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE TRIM('0' FROM u.name) = 'someone'");
168+
}
169+
165170
public function testArithmeticExpressionsSupportedInWherePart(): void
166171
{
167172
$this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE ((u.id + 5000) * u.id + 3) < 10000000');

0 commit comments

Comments
 (0)