Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed Aug 7, 2022
1 parent f7e202f commit 91defd0
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 24 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"squizlabs/php_codesniffer": "3.7.1",
"symfony/cache": "^4.4 || ^5.4 || ^6.0",
"symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0",
"vimeo/psalm": "4.25.0"
"vimeo/psalm": "4.26.0"
},
"conflict": {
"doctrine/annotations": "<1.13 || >= 2.0"
Expand Down
28 changes: 14 additions & 14 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -326,37 +326,37 @@ parameters:
path: lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Expand Down
10 changes: 9 additions & 1 deletion phpstan-dbal2.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ includes:
- phpstan-params.neon

parameters:
reportUnmatchedIgnoredErrors: false

ignoreErrors:
# https://github.com/doctrine/collections/pull/282
- '/Variable \$offset in isset\(\) always exists and is not nullable\./'
Expand All @@ -11,14 +13,20 @@ parameters:
# Class name will change in DBAL 3.
- '/^Class Doctrine\\DBAL\\Platforms\\PostgreSQLPlatform not found\.$/'

# Forward compatibility for DBAL 3.2
# Forward compatibility for DBAL 3.4
- '/^Call to an undefined method Doctrine\\DBAL\\Cache\\QueryCacheProfile::[gs]etResultCache\(\)\.$/'
-
message: '/^Call to an undefined static method Doctrine\\DBAL\\Configuration::[gs]etResultCache\(\)\.$/'
path: lib/Doctrine/ORM/Configuration.php
-
message: '/^Parameter #3 \$resultCache of class Doctrine\\DBAL\\Cache\\QueryCacheProfile constructor/'
path: lib/Doctrine/ORM/AbstractQuery.php
-
message: '/^Parameter #2 \$\w+ of method Doctrine\\DBAL\\Platforms\\AbstractPlatform::getDateAdd\w+Expression\(\) expects int, string given\.$/'
path: lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php
-
message: '/^Parameter #2 \$\w+ of method Doctrine\\DBAL\\Platforms\\AbstractPlatform::getDateSub\w+Expression\(\) expects int, string given\.$/'
path: lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php

# False positive
-
Expand Down
13 changes: 5 additions & 8 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="v4.25.0@d7cd84c4ebca74ba3419b9601f81d177bcbe2aac">
<files psalm-version="4.26.0@6998fabb2bf528b65777bf9941920888d23c03ac">
<file src="lib/Doctrine/ORM/AbstractQuery.php">
<DeprecatedClass occurrences="1">
<code>IterableResult</code>
Expand Down Expand Up @@ -1541,15 +1541,15 @@
</PropertyNotSetInConstructor>
</file>
<file src="lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php">
<InvalidScalarArgument occurrences="7">
<ArgumentTypeCoercion occurrences="7">
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
</InvalidScalarArgument>
</ArgumentTypeCoercion>
<PossiblyInvalidPropertyAssignmentValue occurrences="2">
<code>$parser-&gt;ArithmeticPrimary()</code>
<code>$parser-&gt;ArithmeticPrimary()</code>
Expand All @@ -1574,15 +1574,15 @@
</PropertyNotSetInConstructor>
</file>
<file src="lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php">
<InvalidScalarArgument occurrences="7">
<ArgumentTypeCoercion occurrences="7">
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
<code>$this-&gt;intervalExpression-&gt;dispatch($sqlWalker)</code>
</InvalidScalarArgument>
</ArgumentTypeCoercion>
<UndefinedPropertyFetch occurrences="1">
<code>$this-&gt;unit-&gt;value</code>
</UndefinedPropertyFetch>
Expand Down Expand Up @@ -2777,9 +2777,6 @@
<code>$this-&gt;getClassToExtend() ?: $metadata-&gt;name</code>
<code>array_map('strlen', $paramTypes)</code>
</ArgumentTypeCoercion>
<DeprecatedConstant occurrences="1">
<code>ClassMetadataInfo::GENERATOR_TYPE_UUID</code>
</DeprecatedConstant>
<DocblockTypeContradiction occurrences="1">
<code>class_exists($metadata-&gt;name)</code>
</DocblockTypeContradiction>
Expand Down
15 changes: 15 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
<referencedClass name="Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper"/>
<!-- The exception is thrown by a deprecated method. -->
<referencedClass name="Doctrine\ORM\Cache\Exception\InvalidResultCacheDriver"/>
<!-- We wire the command as long as DBAL ships it -->
<referencedClass name="Doctrine\DBAL\Tools\Console\Command\ReservedWordsCommand" />
<!-- Remove on 2.13.x -->
<referencedClass name="Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector"/>
<referencedClass name="Doctrine\DBAL\Schema\Visitor\RemoveNamespacedAssets"/>
<!-- Remove on 3.0.x -->
<referencedClass name="Doctrine\Common\Persistence\PersistentObject"/>
<referencedClass name="Doctrine\ORM\Exception\UnknownEntityNamespace"/>
Expand All @@ -42,6 +47,9 @@
<file name="lib/Doctrine/ORM/Configuration.php"/>
<file name="lib/Doctrine/ORM/Query/Lexer.php"/>
<file name="lib/Doctrine/ORM/Query/Parser.php"/>
<file name="lib/Doctrine/ORM/Tools/EntityGenerator.php"/>
<!-- Remove on 2.13.x. -->
<file name="lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php" />
</errorLevel>
</DeprecatedConstant>
<DeprecatedInterface>
Expand All @@ -53,13 +61,20 @@
<errorLevel type="suppress">
<!-- We're calling the deprecated method for BC here. -->
<file name="lib/Doctrine/ORM/Internal/SQLResultCasing.php"/>
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::getIdentitySequenceName"/>
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::usesSequenceEmulatedIdentityColumns"/>
<!-- We need to keep the calls for DBAL 2.13 compatibility. -->
<referencedMethod name="Doctrine\DBAL\Cache\QueryCacheProfile::getResultCacheDriver"/>
<referencedMethod name="Doctrine\DBAL\Cache\QueryCacheProfile::setResultCacheDriver"/>
<referencedMethod name="Doctrine\DBAL\Configuration::getResultCacheImpl"/>
<referencedMethod name="Doctrine\DBAL\Configuration::setResultCacheImpl"/>
<referencedMethod name="Doctrine\DBAL\Connection::getSchemaManager"/>
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::getGuidExpression"/>
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::supportsForeignKeyConstraints"/>
<referencedMethod name="Doctrine\DBAL\Types\Type::getName"/>
<!-- Remove on 2.13.x -->
<referencedMethod name="Doctrine\DBAL\Schema\AbstractSchemaManager::getDatabasePlatform"/>
<referencedMethod name="Doctrine\DBAL\Schema\Schema::visit"/>
<!-- Remove on 3.0.x -->
<referencedMethod name="Doctrine\ORM\Internal\Hydration\AbstractHydrator::hydrateRow"/>
<referencedMethod name="Doctrine\ORM\Configuration::ensureProductionSettings"/>
Expand Down

0 comments on commit 91defd0

Please sign in to comment.