File tree Expand file tree Collapse file tree 4 files changed +19
-11
lines changed Expand file tree Collapse file tree 4 files changed +19
-11
lines changed Original file line number Diff line number Diff line change 1010 - src/**
1111 - phpstan*
1212 - psalm*
13- - tests/Doctrine/ StaticAnalysis/**
13+ - tests/StaticAnalysis/**
1414 push :
1515 branches :
1616 - " *.x"
2020 - src/**
2121 - phpstan*
2222 - psalm*
23- - tests/Doctrine/ StaticAnalysis/**
23+ - tests/StaticAnalysis/**
2424
2525jobs :
2626 static-analysis-phpstan :
Original file line number Diff line number Diff 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-
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 ' );
You can’t perform that action at this time.
0 commit comments