Skip to content

Commit 78d0858

Browse files
authored
Fix build (#9964)
1 parent f7e202f commit 78d0858

5 files changed

+44
-24
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"squizlabs/php_codesniffer": "3.7.1",
4949
"symfony/cache": "^4.4 || ^5.4 || ^6.0",
5050
"symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0",
51-
"vimeo/psalm": "4.25.0"
51+
"vimeo/psalm": "4.26.0"
5252
},
5353
"conflict": {
5454
"doctrine/annotations": "<1.13 || >= 2.0"

phpstan-baseline.neon

+14-14
Original file line numberDiff line numberDiff line change
@@ -326,37 +326,37 @@ parameters:
326326
path: lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php
327327

328328
-
329-
message: "#^Parameter \\#2 \\$days of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddDaysExpression\\(\\) expects int, string given\\.$#"
329+
message: "#^Parameter \\#2 \\$days of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddDaysExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#"
330330
count: 1
331331
path: lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php
332332

333333
-
334-
message: "#^Parameter \\#2 \\$hours of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddHourExpression\\(\\) expects int, string given\\.$#"
334+
message: "#^Parameter \\#2 \\$hours of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddHourExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#"
335335
count: 1
336336
path: lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php
337337

338338
-
339-
message: "#^Parameter \\#2 \\$minutes of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddMinutesExpression\\(\\) expects int, string given\\.$#"
339+
message: "#^Parameter \\#2 \\$minutes of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddMinutesExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#"
340340
count: 1
341341
path: lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php
342342

343343
-
344-
message: "#^Parameter \\#2 \\$months of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddMonthExpression\\(\\) expects int, string given\\.$#"
344+
message: "#^Parameter \\#2 \\$months of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddMonthExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#"
345345
count: 1
346346
path: lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php
347347

348348
-
349-
message: "#^Parameter \\#2 \\$seconds of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddSecondsExpression\\(\\) expects int, string given\\.$#"
349+
message: "#^Parameter \\#2 \\$seconds of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddSecondsExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#"
350350
count: 1
351351
path: lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php
352352

353353
-
354-
message: "#^Parameter \\#2 \\$weeks of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddWeeksExpression\\(\\) expects int, string given\\.$#"
354+
message: "#^Parameter \\#2 \\$weeks of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddWeeksExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#"
355355
count: 1
356356
path: lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php
357357

358358
-
359-
message: "#^Parameter \\#2 \\$years of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddYearsExpression\\(\\) expects int, string given\\.$#"
359+
message: "#^Parameter \\#2 \\$years of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddYearsExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#"
360360
count: 1
361361
path: lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php
362362

@@ -366,37 +366,37 @@ parameters:
366366
path: lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php
367367

368368
-
369-
message: "#^Parameter \\#2 \\$days of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubDaysExpression\\(\\) expects int, string given\\.$#"
369+
message: "#^Parameter \\#2 \\$days of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubDaysExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#"
370370
count: 1
371371
path: lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php
372372

373373
-
374-
message: "#^Parameter \\#2 \\$hours of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubHourExpression\\(\\) expects int, string given\\.$#"
374+
message: "#^Parameter \\#2 \\$hours of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubHourExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#"
375375
count: 1
376376
path: lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php
377377

378378
-
379-
message: "#^Parameter \\#2 \\$minutes of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubMinutesExpression\\(\\) expects int, string given\\.$#"
379+
message: "#^Parameter \\#2 \\$minutes of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubMinutesExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#"
380380
count: 1
381381
path: lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php
382382

383383
-
384-
message: "#^Parameter \\#2 \\$months of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubMonthExpression\\(\\) expects int, string given\\.$#"
384+
message: "#^Parameter \\#2 \\$months of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubMonthExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#"
385385
count: 1
386386
path: lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php
387387

388388
-
389-
message: "#^Parameter \\#2 \\$seconds of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubSecondsExpression\\(\\) expects int, string given\\.$#"
389+
message: "#^Parameter \\#2 \\$seconds of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubSecondsExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#"
390390
count: 1
391391
path: lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php
392392

393393
-
394-
message: "#^Parameter \\#2 \\$weeks of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubWeeksExpression\\(\\) expects int, string given\\.$#"
394+
message: "#^Parameter \\#2 \\$weeks of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubWeeksExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#"
395395
count: 1
396396
path: lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php
397397

398398
-
399-
message: "#^Parameter \\#2 \\$years of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubYearsExpression\\(\\) expects int, string given\\.$#"
399+
message: "#^Parameter \\#2 \\$years of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubYearsExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#"
400400
count: 1
401401
path: lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php
402402

phpstan-dbal2.neon

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ includes:
33
- phpstan-params.neon
44

55
parameters:
6+
reportUnmatchedIgnoredErrors: false
7+
68
ignoreErrors:
79
# https://github.com/doctrine/collections/pull/282
810
- '/Variable \$offset in isset\(\) always exists and is not nullable\./'
@@ -11,14 +13,20 @@ parameters:
1113
# Class name will change in DBAL 3.
1214
- '/^Class Doctrine\\DBAL\\Platforms\\PostgreSQLPlatform not found\.$/'
1315

14-
# Forward compatibility for DBAL 3.2
16+
# Forward compatibility for DBAL 3.4
1517
- '/^Call to an undefined method Doctrine\\DBAL\\Cache\\QueryCacheProfile::[gs]etResultCache\(\)\.$/'
1618
-
1719
message: '/^Call to an undefined static method Doctrine\\DBAL\\Configuration::[gs]etResultCache\(\)\.$/'
1820
path: lib/Doctrine/ORM/Configuration.php
1921
-
2022
message: '/^Parameter #3 \$resultCache of class Doctrine\\DBAL\\Cache\\QueryCacheProfile constructor/'
2123
path: lib/Doctrine/ORM/AbstractQuery.php
24+
-
25+
message: '/^Parameter #2 \$\w+ of method Doctrine\\DBAL\\Platforms\\AbstractPlatform::getDateAdd\w+Expression\(\) expects int, string given\.$/'
26+
path: lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php
27+
-
28+
message: '/^Parameter #2 \$\w+ of method Doctrine\\DBAL\\Platforms\\AbstractPlatform::getDateSub\w+Expression\(\) expects int, string given\.$/'
29+
path: lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php
2230

2331
# False positive
2432
-

psalm-baseline.xml

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="v4.25.0@d7cd84c4ebca74ba3419b9601f81d177bcbe2aac">
2+
<files psalm-version="4.26.0@6998fabb2bf528b65777bf9941920888d23c03ac">
33
<file src="lib/Doctrine/ORM/AbstractQuery.php">
44
<DeprecatedClass occurrences="1">
55
<code>IterableResult</code>
@@ -1541,15 +1541,15 @@
15411541
</PropertyNotSetInConstructor>
15421542
</file>
15431543
<file src="lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php">
1544-
<InvalidScalarArgument occurrences="7">
1544+
<ArgumentTypeCoercion occurrences="7">
15451545
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
15461546
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
15471547
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
15481548
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
15491549
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
15501550
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
15511551
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
1552-
</InvalidScalarArgument>
1552+
</ArgumentTypeCoercion>
15531553
<PossiblyInvalidPropertyAssignmentValue occurrences="2">
15541554
<code>$parser-&gt;ArithmeticPrimary()</code>
15551555
<code>$parser-&gt;ArithmeticPrimary()</code>
@@ -1574,15 +1574,15 @@
15741574
</PropertyNotSetInConstructor>
15751575
</file>
15761576
<file src="lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php">
1577-
<InvalidScalarArgument occurrences="7">
1577+
<ArgumentTypeCoercion occurrences="7">
15781578
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
15791579
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
15801580
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
15811581
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
15821582
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
15831583
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
15841584
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
1585-
</InvalidScalarArgument>
1585+
</ArgumentTypeCoercion>
15861586
<UndefinedPropertyFetch occurrences="1">
15871587
<code>$this-&gt;unit-&gt;value</code>
15881588
</UndefinedPropertyFetch>
@@ -2777,9 +2777,6 @@
27772777
<code>$this-&gt;getClassToExtend() ?: $metadata-&gt;name</code>
27782778
<code>array_map('strlen', $paramTypes)</code>
27792779
</ArgumentTypeCoercion>
2780-
<DeprecatedConstant occurrences="1">
2781-
<code>ClassMetadataInfo::GENERATOR_TYPE_UUID</code>
2782-
</DeprecatedConstant>
27832780
<DocblockTypeContradiction occurrences="1">
27842781
<code>class_exists($metadata-&gt;name)</code>
27852782
</DocblockTypeContradiction>

psalm.xml

+15
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
<referencedClass name="Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper"/>
2525
<!-- The exception is thrown by a deprecated method. -->
2626
<referencedClass name="Doctrine\ORM\Cache\Exception\InvalidResultCacheDriver"/>
27+
<!-- We wire the command as long as DBAL ships it -->
28+
<referencedClass name="Doctrine\DBAL\Tools\Console\Command\ReservedWordsCommand" />
29+
<!-- Remove on 2.13.x -->
30+
<referencedClass name="Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector"/>
31+
<referencedClass name="Doctrine\DBAL\Schema\Visitor\RemoveNamespacedAssets"/>
2732
<!-- Remove on 3.0.x -->
2833
<referencedClass name="Doctrine\Common\Persistence\PersistentObject"/>
2934
<referencedClass name="Doctrine\ORM\Exception\UnknownEntityNamespace"/>
@@ -42,6 +47,9 @@
4247
<file name="lib/Doctrine/ORM/Configuration.php"/>
4348
<file name="lib/Doctrine/ORM/Query/Lexer.php"/>
4449
<file name="lib/Doctrine/ORM/Query/Parser.php"/>
50+
<file name="lib/Doctrine/ORM/Tools/EntityGenerator.php"/>
51+
<!-- Remove on 2.13.x. -->
52+
<file name="lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php" />
4553
</errorLevel>
4654
</DeprecatedConstant>
4755
<DeprecatedInterface>
@@ -53,13 +61,20 @@
5361
<errorLevel type="suppress">
5462
<!-- We're calling the deprecated method for BC here. -->
5563
<file name="lib/Doctrine/ORM/Internal/SQLResultCasing.php"/>
64+
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::getIdentitySequenceName"/>
65+
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::usesSequenceEmulatedIdentityColumns"/>
5666
<!-- We need to keep the calls for DBAL 2.13 compatibility. -->
5767
<referencedMethod name="Doctrine\DBAL\Cache\QueryCacheProfile::getResultCacheDriver"/>
5868
<referencedMethod name="Doctrine\DBAL\Cache\QueryCacheProfile::setResultCacheDriver"/>
5969
<referencedMethod name="Doctrine\DBAL\Configuration::getResultCacheImpl"/>
6070
<referencedMethod name="Doctrine\DBAL\Configuration::setResultCacheImpl"/>
6171
<referencedMethod name="Doctrine\DBAL\Connection::getSchemaManager"/>
6272
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::getGuidExpression"/>
73+
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::supportsForeignKeyConstraints"/>
74+
<referencedMethod name="Doctrine\DBAL\Types\Type::getName"/>
75+
<!-- Remove on 2.13.x -->
76+
<referencedMethod name="Doctrine\DBAL\Schema\AbstractSchemaManager::getDatabasePlatform"/>
77+
<referencedMethod name="Doctrine\DBAL\Schema\Schema::visit"/>
6378
<!-- Remove on 3.0.x -->
6479
<referencedMethod name="Doctrine\ORM\Internal\Hydration\AbstractHydrator::hydrateRow"/>
6580
<referencedMethod name="Doctrine\ORM\Configuration::ensureProductionSettings"/>

0 commit comments

Comments
 (0)