From d070aa9e17278b79982c436802b43a54865b64b9 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 21:22:54 +0200 Subject: [PATCH 1/7] Regenerate baseline --- phpstan-baseline-dbal-4.neon | 55 +++++++ phpstan-baseline.neon | 275 +++++++++++++++++++---------------- 2 files changed, 208 insertions(+), 122 deletions(-) diff --git a/phpstan-baseline-dbal-4.neon b/phpstan-baseline-dbal-4.neon index 24536b91..c1751beb 100644 --- a/phpstan-baseline-dbal-4.neon +++ b/phpstan-baseline-dbal-4.neon @@ -30,4 +30,59 @@ parameters: count: 1 path: src/Type/Doctrine/Query/QueryResultTypeWalker.php + - + rawMessage: ''' + Access to constant on deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + ''' + identifier: classConstant.deprecatedClass + count: 1 + path: src/Doctrine/Mapping/ClassMetadataFactory.php + + - + rawMessage: ''' + Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + ''' + identifier: method.deprecatedClass + count: 1 + path: src/Doctrine/Mapping/ClassMetadataFactory.php + + - + rawMessage: ''' + Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + ''' + identifier: new.deprecatedClass + count: 1 + path: src/Doctrine/Mapping/ClassMetadataFactory.php + - + rawMessage: 'Call to an undefined static method Doctrine\DBAL\Types\ConversionException::conversionFailed().' + identifier: staticMethod.notFound + count: 2 + path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUlidType.php + + - + rawMessage: 'Call to an undefined static method Doctrine\DBAL\Types\ConversionException::conversionFailedInvalidType().' + identifier: staticMethod.notFound + count: 2 + path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUlidType.php + + - + rawMessage: 'Call to an undefined static method Doctrine\DBAL\Types\ConversionException::conversionFailed().' + identifier: staticMethod.notFound + count: 2 + path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUuidType.php + + - + rawMessage: 'Call to an undefined static method Doctrine\DBAL\Types\ConversionException::conversionFailedInvalidType().' + identifier: staticMethod.notFound + count: 2 + path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUuidType.php diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index cebcd4e2..c30f7402 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,325 +1,356 @@ parameters: ignoreErrors: - - message: '#^Call to internal method Doctrine\\DBAL\\Connection\:\:getParams\(\) from outside its root namespace Doctrine\.$#' + rawMessage: 'Call to internal method Doctrine\DBAL\Connection::getParams() from outside its root namespace Doctrine.' identifier: method.internal count: 2 path: src/Doctrine/Driver/DriverDetector.php - - message: ''' - #^Access to constant on deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: - This class will be removed in 3\.0 without replacement\.$# + rawMessage: ''' + Access to constant on deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php ''' identifier: classConstant.deprecatedClass count: 1 path: src/Doctrine/Mapping/ClassMetadataFactory.php - - message: ''' - #^Call to method __construct\(\) of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: - This class will be removed in 3\.0 without replacement\.$# + rawMessage: ''' + Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php ''' identifier: method.deprecatedClass count: 1 path: src/Doctrine/Mapping/ClassMetadataFactory.php - - message: ''' - #^Instantiation of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: - This class will be removed in 3\.0 without replacement\.$# + rawMessage: ''' + Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php ''' identifier: new.deprecatedClass count: 1 path: src/Doctrine/Mapping/ClassMetadataFactory.php - - message: '#^Calling PHPStan\\Type\\TypehintHelper\:\:decideType\(\) is not covered by backward compatibility promise\. The method might change in a minor PHPStan version\.$#' + rawMessage: 'Calling PHPStan\Type\TypehintHelper::decideType() is not covered by backward compatibility promise. The method might change in a minor PHPStan version.' identifier: phpstanApi.method count: 1 path: src/Rules/Doctrine/ORM/EntityColumnRule.php - - message: '#^Calling PHPStan\\Type\\TypehintHelper\:\:decideType\(\) is not covered by backward compatibility promise\. The method might change in a minor PHPStan version\.$#' + rawMessage: 'Calling PHPStan\Type\TypehintHelper::decideType() is not covered by backward compatibility promise. The method might change in a minor PHPStan version.' identifier: phpstanApi.method count: 1 path: src/Rules/Doctrine/ORM/EntityRelationRule.php - - message: '#^PHPDoc tag @var with type class\-string is not subtype of native type ''Doctrine\\\\Bundle…''\.$#' + rawMessage: PHPDoc tag @var with type class-string is not subtype of native type 'Doctrine\\Bundle…'. identifier: varTag.nativeType count: 1 path: src/Stubs/Doctrine/StubFilesExtensionLoader.php - - message: ''' - #^Catching deprecated class Doctrine\\Common\\CommonException\: - The doctrine/common package is deprecated, please use specific packages and their exceptions instead\.$# + rawMessage: ''' + Catching deprecated class Doctrine\Common\CommonException: + The doctrine/common package is deprecated, please use specific packages and their exceptions instead. ''' identifier: catch.deprecatedClass count: 1 path: src/Type/Doctrine/CreateQueryDynamicReturnTypeExtension.php - - message: ''' - #^Catching deprecated class Doctrine\\ORM\\ORMException\: - Use Doctrine\\ORM\\Exception\\ORMException for catch and instanceof$# - ''' - identifier: catch.deprecatedClass - count: 1 - path: src/Type/Doctrine/CreateQueryDynamicReturnTypeExtension.php - - - - message: ''' - #^Access to constant on deprecated class Doctrine\\DBAL\\Types\\ArrayType\: - Use \{@link JsonType\} instead\.$# - ''' - identifier: classConstant.deprecatedClass - count: 1 - path: src/Type/Doctrine/Descriptors/ArrayType.php - - - - message: ''' - #^Access to constant on deprecated class Doctrine\\DBAL\\Types\\ObjectType\: - Use \{@link JsonType\} instead\.$# - ''' - identifier: classConstant.deprecatedClass - count: 1 - path: src/Type/Doctrine/Descriptors/ObjectType.php - - - - message: '#^Parameter \$condExpr of method PHPStan\\Type\\Doctrine\\Query\\QueryResultTypeWalker\:\:walkConditionalExpression\(\) has typehint with internal interface Doctrine\\ORM\\Query\\AST\\Phase2OptimizableConditional\.$#' + rawMessage: 'Parameter $condExpr of method PHPStan\Type\Doctrine\Query\QueryResultTypeWalker::walkConditionalExpression() has typehint with internal interface Doctrine\ORM\Query\AST\Phase2OptimizableConditional.' identifier: parameter.internalInterface count: 1 path: src/Type/Doctrine/Query/QueryResultTypeWalker.php - - message: '#^Parameter \$condExpr of method PHPStan\\Type\\Doctrine\\Query\\QueryResultTypeWalker\:\:walkJoinAssociationDeclaration\(\) has typehint with internal interface Doctrine\\ORM\\Query\\AST\\Phase2OptimizableConditional\.$#' + rawMessage: 'Parameter $condExpr of method PHPStan\Type\Doctrine\Query\QueryResultTypeWalker::walkJoinAssociationDeclaration() has typehint with internal interface Doctrine\ORM\Query\AST\Phase2OptimizableConditional.' identifier: parameter.internalInterface count: 1 path: src/Type/Doctrine/Query/QueryResultTypeWalker.php - - message: ''' - #^Catching deprecated class Doctrine\\Common\\CommonException\: - The doctrine/common package is deprecated, please use specific packages and their exceptions instead\.$# - ''' - identifier: catch.deprecatedClass - count: 1 - path: src/Type/Doctrine/QueryBuilder/QueryBuilderGetQueryDynamicReturnTypeExtension.php - - - - message: ''' - #^Catching deprecated class Doctrine\\ORM\\ORMException\: - Use Doctrine\\ORM\\Exception\\ORMException for catch and instanceof$# + rawMessage: ''' + Catching deprecated class Doctrine\Common\CommonException: + The doctrine/common package is deprecated, please use specific packages and their exceptions instead. ''' identifier: catch.deprecatedClass count: 1 path: src/Type/Doctrine/QueryBuilder/QueryBuilderGetQueryDynamicReturnTypeExtension.php - - message: '#^Accessing PHPStan\\Rules\\Classes\\InstantiationRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#' + rawMessage: Accessing PHPStan\Rules\Classes\InstantiationRule::class is not covered by backward compatibility promise. The class might change in a minor PHPStan version. identifier: phpstanApi.classConstant count: 1 path: tests/Classes/DoctrineProxyForbiddenClassNamesExtensionTest.php - - message: ''' - #^Call to method __construct\(\) of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: - This class will be removed in 3\.0 without replacement\.$# + rawMessage: ''' + Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php ''' identifier: method.deprecatedClass count: 1 path: tests/Classes/entity-manager.php - - message: ''' - #^Instantiation of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: - This class will be removed in 3\.0 without replacement\.$# + rawMessage: ''' + Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php ''' identifier: new.deprecatedClass count: 1 path: tests/Classes/entity-manager.php - - message: ''' - #^Call to method __construct\(\) of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: - This class will be removed in 3\.0 without replacement\.$# + rawMessage: ''' + Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php ''' identifier: method.deprecatedClass count: 1 path: tests/DoctrineIntegration/ORM/entity-manager.php - - message: ''' - #^Instantiation of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: - This class will be removed in 3\.0 without replacement\.$# + rawMessage: ''' + Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php ''' identifier: new.deprecatedClass count: 1 path: tests/DoctrineIntegration/ORM/entity-manager.php - - message: '#^Call to internal method PHPUnit\\Framework\\TestCase\:\:dataName\(\) from outside its root namespace PHPUnit\.$#' + rawMessage: 'Call to internal method PHPUnit\Framework\TestCase::dataName() from outside its root namespace PHPUnit.' identifier: method.internal - count: 14 + count: 13 path: tests/Platform/QueryResultTypeWalkerFetchTypeMatrixTest.php - - message: ''' - #^Call to method __construct\(\) of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: - This class will be removed in 3\.0 without replacement\.$# + rawMessage: ''' + Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php ''' identifier: method.deprecatedClass count: 1 path: tests/Platform/QueryResultTypeWalkerFetchTypeMatrixTest.php - - message: ''' - #^Instantiation of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: - This class will be removed in 3\.0 without replacement\.$# + rawMessage: ''' + Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php ''' identifier: new.deprecatedClass count: 1 path: tests/Platform/QueryResultTypeWalkerFetchTypeMatrixTest.php - - message: '#^Call to internal method Doctrine\\DBAL\\Driver\\PDO\\Connection\:\:__construct\(\) from outside its root namespace Doctrine\.$#' + rawMessage: 'Call to internal method Doctrine\DBAL\Driver\PDO\Connection::__construct() from outside its root namespace Doctrine.' identifier: method.internal count: 1 path: tests/Platform/UnknownDriver.php - - message: '#^Accessing PHPStan\\Rules\\DeadCode\\UnusedPrivatePropertyRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#' + rawMessage: Accessing PHPStan\Rules\DeadCode\UnusedPrivatePropertyRule::class is not covered by backward compatibility promise. The class might change in a minor PHPStan version. identifier: phpstanApi.classConstant count: 1 path: tests/Rules/DeadCode/UnusedPrivatePropertyRuleTest.php - - message: ''' - #^Call to method __construct\(\) of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: - This class will be removed in 3\.0 without replacement\.$# + rawMessage: ''' + Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php ''' identifier: method.deprecatedClass count: 1 path: tests/Rules/DeadCode/entity-manager.php - - message: ''' - #^Instantiation of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: - This class will be removed in 3\.0 without replacement\.$# + rawMessage: ''' + Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php ''' identifier: new.deprecatedClass count: 1 path: tests/Rules/DeadCode/entity-manager.php - - message: ''' - #^Access to constant on deprecated class Doctrine\\DBAL\\Types\\ArrayType\: - Use \{@link JsonType\} instead\.$# - ''' - identifier: classConstant.deprecatedClass + rawMessage: 'Parameter #2 $type of static method Doctrine\DBAL\Types\Type::addType() expects class-string|Doctrine\DBAL\Types\Type, string given.' + identifier: argument.type count: 1 path: tests/Rules/Doctrine/ORM/EntityColumnRuleTest.php - - message: '#^Accessing PHPStan\\Rules\\Methods\\CallMethodsRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#' + rawMessage: 'Method PHPStan\Rules\Doctrine\ORM\FakeTestingRamseyUuidType::requiresSQLCommentHint() never returns false so the return type can be changed to true.' + identifier: return.tooWideBool + count: 1 + path: tests/Rules/Doctrine/ORM/FakeTestingRamseyUuidType.php + + - + rawMessage: 'Call to an undefined static method Doctrine\DBAL\Types\ConversionException::conversionFailed().' + identifier: staticMethod.notFound + count: 2 + path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUlidType.php + + - + rawMessage: 'Call to an undefined static method Doctrine\DBAL\Types\ConversionException::conversionFailedInvalidType().' + identifier: staticMethod.notFound + count: 2 + path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUlidType.php + + - + rawMessage: 'Method PHPStan\Rules\Doctrine\ORM\FakeTestingSymfonyUlidType::requiresSQLCommentHint() never returns false so the return type can be changed to true.' + identifier: return.tooWideBool + count: 1 + path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUlidType.php + + - + rawMessage: 'Call to an undefined static method Doctrine\DBAL\Types\ConversionException::conversionFailed().' + identifier: staticMethod.notFound + count: 2 + path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUuidType.php + + - + rawMessage: 'Call to an undefined static method Doctrine\DBAL\Types\ConversionException::conversionFailedInvalidType().' + identifier: staticMethod.notFound + count: 2 + path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUuidType.php + + - + rawMessage: 'Method PHPStan\Rules\Doctrine\ORM\FakeTestingSymfonyUuidType::requiresSQLCommentHint() never returns false so the return type can be changed to true.' + identifier: return.tooWideBool + count: 1 + path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUuidType.php + + - + rawMessage: Accessing PHPStan\Rules\Methods\CallMethodsRule::class is not covered by backward compatibility promise. The class might change in a minor PHPStan version. identifier: phpstanApi.classConstant count: 1 path: tests/Rules/Doctrine/ORM/MagicRepositoryMethodCallRuleTest.php - - message: '#^Accessing PHPStan\\Rules\\Exceptions\\CatchWithUnthrownExceptionRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#' + rawMessage: Accessing PHPStan\Rules\Exceptions\CatchWithUnthrownExceptionRule::class is not covered by backward compatibility promise. The class might change in a minor PHPStan version. identifier: phpstanApi.classConstant count: 1 path: tests/Rules/Exceptions/CatchWithUnthrownExceptionRuleTest.php - - message: '#^Accessing PHPStan\\Rules\\Exceptions\\TooWideMethodThrowTypeRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#' + rawMessage: Accessing PHPStan\Rules\Exceptions\TooWideMethodThrowTypeRule::class is not covered by backward compatibility promise. The class might change in a minor PHPStan version. identifier: phpstanApi.classConstant count: 1 path: tests/Rules/Exceptions/TooWideMethodThrowTypeRuleTest.php - - message: '#^Accessing PHPStan\\Rules\\DeadCode\\UnusedPrivatePropertyRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#' + rawMessage: Accessing PHPStan\Rules\DeadCode\UnusedPrivatePropertyRule::class is not covered by backward compatibility promise. The class might change in a minor PHPStan version. identifier: phpstanApi.classConstant count: 1 path: tests/Rules/Properties/MissingGedmoByPhpDocPropertyAssignRuleTest.php - - message: '#^Accessing PHPStan\\Rules\\DeadCode\\UnusedPrivatePropertyRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#' + rawMessage: Accessing PHPStan\Rules\DeadCode\UnusedPrivatePropertyRule::class is not covered by backward compatibility promise. The class might change in a minor PHPStan version. identifier: phpstanApi.classConstant count: 1 path: tests/Rules/Properties/MissingGedmoPropertyAssignRuleTest.php - - message: '#^Accessing PHPStan\\Rules\\Properties\\MissingReadOnlyByPhpDocPropertyAssignRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#' + rawMessage: Accessing PHPStan\Rules\Properties\MissingReadOnlyByPhpDocPropertyAssignRule::class is not covered by backward compatibility promise. The class might change in a minor PHPStan version. identifier: phpstanApi.classConstant count: 1 path: tests/Rules/Properties/MissingReadOnlyByPhpDocPropertyAssignRuleTest.php - - message: '#^Accessing PHPStan\\Rules\\Properties\\MissingReadOnlyPropertyAssignRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#' + rawMessage: Accessing PHPStan\Rules\Properties\MissingReadOnlyPropertyAssignRule::class is not covered by backward compatibility promise. The class might change in a minor PHPStan version. identifier: phpstanApi.classConstant count: 1 path: tests/Rules/Properties/MissingReadOnlyPropertyAssignRuleTest.php - - message: ''' - #^Call to method __construct\(\) of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: - This class will be removed in 3\.0 without replacement\.$# + rawMessage: ''' + Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php ''' identifier: method.deprecatedClass count: 1 path: tests/Rules/Properties/entity-manager.php - - message: ''' - #^Instantiation of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: - This class will be removed in 3\.0 without replacement\.$# + rawMessage: ''' + Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php ''' identifier: new.deprecatedClass count: 1 path: tests/Rules/Properties/entity-manager.php - - message: ''' - #^Call to method __construct\(\) of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: - This class will be removed in 3\.0 without replacement\.$# + rawMessage: ''' + Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php ''' identifier: method.deprecatedClass count: 1 path: tests/Type/Doctrine/DBAL/mysqli.php - - message: ''' - #^Instantiation of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: - This class will be removed in 3\.0 without replacement\.$# + rawMessage: ''' + Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php ''' identifier: new.deprecatedClass count: 1 path: tests/Type/Doctrine/DBAL/mysqli.php - - message: ''' - #^Call to method __construct\(\) of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: - This class will be removed in 3\.0 without replacement\.$# + rawMessage: ''' + Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php ''' identifier: method.deprecatedClass count: 1 path: tests/Type/Doctrine/DBAL/pdo.php - - message: ''' - #^Instantiation of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: - This class will be removed in 3\.0 without replacement\.$# + rawMessage: ''' + Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php ''' identifier: new.deprecatedClass count: 1 path: tests/Type/Doctrine/DBAL/pdo.php - - - - message: '#^Parameter references internal interface Doctrine\\ORM\\Query\\AST\\Phase2OptimizableConditional in its type\.$#' - identifier: parameter.internalInterface - count: 2 - path: src/Type/Doctrine/Query/QueryResultTypeWalker.php From 350789bde4fb1a7b8ec6b4aa4a0320633cd351e2 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 21:23:34 +0200 Subject: [PATCH 2/7] Discard changes to phpstan-baseline.neon --- phpstan-baseline.neon | 275 +++++++++++++++++++----------------------- 1 file changed, 122 insertions(+), 153 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index c30f7402..cebcd4e2 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,356 +1,325 @@ parameters: ignoreErrors: - - rawMessage: 'Call to internal method Doctrine\DBAL\Connection::getParams() from outside its root namespace Doctrine.' + message: '#^Call to internal method Doctrine\\DBAL\\Connection\:\:getParams\(\) from outside its root namespace Doctrine\.$#' identifier: method.internal count: 2 path: src/Doctrine/Driver/DriverDetector.php - - rawMessage: ''' - Access to constant on deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: - This class will be removed in 3.0 without replacement. - Copyright (c) Doctrine Project - From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + message: ''' + #^Access to constant on deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: + This class will be removed in 3\.0 without replacement\.$# ''' identifier: classConstant.deprecatedClass count: 1 path: src/Doctrine/Mapping/ClassMetadataFactory.php - - rawMessage: ''' - Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: - This class will be removed in 3.0 without replacement. - Copyright (c) Doctrine Project - From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + message: ''' + #^Call to method __construct\(\) of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: + This class will be removed in 3\.0 without replacement\.$# ''' identifier: method.deprecatedClass count: 1 path: src/Doctrine/Mapping/ClassMetadataFactory.php - - rawMessage: ''' - Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: - This class will be removed in 3.0 without replacement. - Copyright (c) Doctrine Project - From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + message: ''' + #^Instantiation of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: + This class will be removed in 3\.0 without replacement\.$# ''' identifier: new.deprecatedClass count: 1 path: src/Doctrine/Mapping/ClassMetadataFactory.php - - rawMessage: 'Calling PHPStan\Type\TypehintHelper::decideType() is not covered by backward compatibility promise. The method might change in a minor PHPStan version.' + message: '#^Calling PHPStan\\Type\\TypehintHelper\:\:decideType\(\) is not covered by backward compatibility promise\. The method might change in a minor PHPStan version\.$#' identifier: phpstanApi.method count: 1 path: src/Rules/Doctrine/ORM/EntityColumnRule.php - - rawMessage: 'Calling PHPStan\Type\TypehintHelper::decideType() is not covered by backward compatibility promise. The method might change in a minor PHPStan version.' + message: '#^Calling PHPStan\\Type\\TypehintHelper\:\:decideType\(\) is not covered by backward compatibility promise\. The method might change in a minor PHPStan version\.$#' identifier: phpstanApi.method count: 1 path: src/Rules/Doctrine/ORM/EntityRelationRule.php - - rawMessage: PHPDoc tag @var with type class-string is not subtype of native type 'Doctrine\\Bundle…'. + message: '#^PHPDoc tag @var with type class\-string is not subtype of native type ''Doctrine\\\\Bundle…''\.$#' identifier: varTag.nativeType count: 1 path: src/Stubs/Doctrine/StubFilesExtensionLoader.php - - rawMessage: ''' - Catching deprecated class Doctrine\Common\CommonException: - The doctrine/common package is deprecated, please use specific packages and their exceptions instead. + message: ''' + #^Catching deprecated class Doctrine\\Common\\CommonException\: + The doctrine/common package is deprecated, please use specific packages and their exceptions instead\.$# ''' identifier: catch.deprecatedClass count: 1 path: src/Type/Doctrine/CreateQueryDynamicReturnTypeExtension.php - - rawMessage: 'Parameter $condExpr of method PHPStan\Type\Doctrine\Query\QueryResultTypeWalker::walkConditionalExpression() has typehint with internal interface Doctrine\ORM\Query\AST\Phase2OptimizableConditional.' + message: ''' + #^Catching deprecated class Doctrine\\ORM\\ORMException\: + Use Doctrine\\ORM\\Exception\\ORMException for catch and instanceof$# + ''' + identifier: catch.deprecatedClass + count: 1 + path: src/Type/Doctrine/CreateQueryDynamicReturnTypeExtension.php + + - + message: ''' + #^Access to constant on deprecated class Doctrine\\DBAL\\Types\\ArrayType\: + Use \{@link JsonType\} instead\.$# + ''' + identifier: classConstant.deprecatedClass + count: 1 + path: src/Type/Doctrine/Descriptors/ArrayType.php + + - + message: ''' + #^Access to constant on deprecated class Doctrine\\DBAL\\Types\\ObjectType\: + Use \{@link JsonType\} instead\.$# + ''' + identifier: classConstant.deprecatedClass + count: 1 + path: src/Type/Doctrine/Descriptors/ObjectType.php + + - + message: '#^Parameter \$condExpr of method PHPStan\\Type\\Doctrine\\Query\\QueryResultTypeWalker\:\:walkConditionalExpression\(\) has typehint with internal interface Doctrine\\ORM\\Query\\AST\\Phase2OptimizableConditional\.$#' identifier: parameter.internalInterface count: 1 path: src/Type/Doctrine/Query/QueryResultTypeWalker.php - - rawMessage: 'Parameter $condExpr of method PHPStan\Type\Doctrine\Query\QueryResultTypeWalker::walkJoinAssociationDeclaration() has typehint with internal interface Doctrine\ORM\Query\AST\Phase2OptimizableConditional.' + message: '#^Parameter \$condExpr of method PHPStan\\Type\\Doctrine\\Query\\QueryResultTypeWalker\:\:walkJoinAssociationDeclaration\(\) has typehint with internal interface Doctrine\\ORM\\Query\\AST\\Phase2OptimizableConditional\.$#' identifier: parameter.internalInterface count: 1 path: src/Type/Doctrine/Query/QueryResultTypeWalker.php - - rawMessage: ''' - Catching deprecated class Doctrine\Common\CommonException: - The doctrine/common package is deprecated, please use specific packages and their exceptions instead. + message: ''' + #^Catching deprecated class Doctrine\\Common\\CommonException\: + The doctrine/common package is deprecated, please use specific packages and their exceptions instead\.$# + ''' + identifier: catch.deprecatedClass + count: 1 + path: src/Type/Doctrine/QueryBuilder/QueryBuilderGetQueryDynamicReturnTypeExtension.php + + - + message: ''' + #^Catching deprecated class Doctrine\\ORM\\ORMException\: + Use Doctrine\\ORM\\Exception\\ORMException for catch and instanceof$# ''' identifier: catch.deprecatedClass count: 1 path: src/Type/Doctrine/QueryBuilder/QueryBuilderGetQueryDynamicReturnTypeExtension.php - - rawMessage: Accessing PHPStan\Rules\Classes\InstantiationRule::class is not covered by backward compatibility promise. The class might change in a minor PHPStan version. + message: '#^Accessing PHPStan\\Rules\\Classes\\InstantiationRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#' identifier: phpstanApi.classConstant count: 1 path: tests/Classes/DoctrineProxyForbiddenClassNamesExtensionTest.php - - rawMessage: ''' - Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: - This class will be removed in 3.0 without replacement. - Copyright (c) Doctrine Project - From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + message: ''' + #^Call to method __construct\(\) of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: + This class will be removed in 3\.0 without replacement\.$# ''' identifier: method.deprecatedClass count: 1 path: tests/Classes/entity-manager.php - - rawMessage: ''' - Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: - This class will be removed in 3.0 without replacement. - Copyright (c) Doctrine Project - From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + message: ''' + #^Instantiation of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: + This class will be removed in 3\.0 without replacement\.$# ''' identifier: new.deprecatedClass count: 1 path: tests/Classes/entity-manager.php - - rawMessage: ''' - Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: - This class will be removed in 3.0 without replacement. - Copyright (c) Doctrine Project - From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + message: ''' + #^Call to method __construct\(\) of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: + This class will be removed in 3\.0 without replacement\.$# ''' identifier: method.deprecatedClass count: 1 path: tests/DoctrineIntegration/ORM/entity-manager.php - - rawMessage: ''' - Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: - This class will be removed in 3.0 without replacement. - Copyright (c) Doctrine Project - From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + message: ''' + #^Instantiation of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: + This class will be removed in 3\.0 without replacement\.$# ''' identifier: new.deprecatedClass count: 1 path: tests/DoctrineIntegration/ORM/entity-manager.php - - rawMessage: 'Call to internal method PHPUnit\Framework\TestCase::dataName() from outside its root namespace PHPUnit.' + message: '#^Call to internal method PHPUnit\\Framework\\TestCase\:\:dataName\(\) from outside its root namespace PHPUnit\.$#' identifier: method.internal - count: 13 + count: 14 path: tests/Platform/QueryResultTypeWalkerFetchTypeMatrixTest.php - - rawMessage: ''' - Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: - This class will be removed in 3.0 without replacement. - Copyright (c) Doctrine Project - From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + message: ''' + #^Call to method __construct\(\) of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: + This class will be removed in 3\.0 without replacement\.$# ''' identifier: method.deprecatedClass count: 1 path: tests/Platform/QueryResultTypeWalkerFetchTypeMatrixTest.php - - rawMessage: ''' - Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: - This class will be removed in 3.0 without replacement. - Copyright (c) Doctrine Project - From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + message: ''' + #^Instantiation of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: + This class will be removed in 3\.0 without replacement\.$# ''' identifier: new.deprecatedClass count: 1 path: tests/Platform/QueryResultTypeWalkerFetchTypeMatrixTest.php - - rawMessage: 'Call to internal method Doctrine\DBAL\Driver\PDO\Connection::__construct() from outside its root namespace Doctrine.' + message: '#^Call to internal method Doctrine\\DBAL\\Driver\\PDO\\Connection\:\:__construct\(\) from outside its root namespace Doctrine\.$#' identifier: method.internal count: 1 path: tests/Platform/UnknownDriver.php - - rawMessage: Accessing PHPStan\Rules\DeadCode\UnusedPrivatePropertyRule::class is not covered by backward compatibility promise. The class might change in a minor PHPStan version. + message: '#^Accessing PHPStan\\Rules\\DeadCode\\UnusedPrivatePropertyRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#' identifier: phpstanApi.classConstant count: 1 path: tests/Rules/DeadCode/UnusedPrivatePropertyRuleTest.php - - rawMessage: ''' - Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: - This class will be removed in 3.0 without replacement. - Copyright (c) Doctrine Project - From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + message: ''' + #^Call to method __construct\(\) of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: + This class will be removed in 3\.0 without replacement\.$# ''' identifier: method.deprecatedClass count: 1 path: tests/Rules/DeadCode/entity-manager.php - - rawMessage: ''' - Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: - This class will be removed in 3.0 without replacement. - Copyright (c) Doctrine Project - From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + message: ''' + #^Instantiation of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: + This class will be removed in 3\.0 without replacement\.$# ''' identifier: new.deprecatedClass count: 1 path: tests/Rules/DeadCode/entity-manager.php - - rawMessage: 'Parameter #2 $type of static method Doctrine\DBAL\Types\Type::addType() expects class-string|Doctrine\DBAL\Types\Type, string given.' - identifier: argument.type + message: ''' + #^Access to constant on deprecated class Doctrine\\DBAL\\Types\\ArrayType\: + Use \{@link JsonType\} instead\.$# + ''' + identifier: classConstant.deprecatedClass count: 1 path: tests/Rules/Doctrine/ORM/EntityColumnRuleTest.php - - rawMessage: 'Method PHPStan\Rules\Doctrine\ORM\FakeTestingRamseyUuidType::requiresSQLCommentHint() never returns false so the return type can be changed to true.' - identifier: return.tooWideBool - count: 1 - path: tests/Rules/Doctrine/ORM/FakeTestingRamseyUuidType.php - - - - rawMessage: 'Call to an undefined static method Doctrine\DBAL\Types\ConversionException::conversionFailed().' - identifier: staticMethod.notFound - count: 2 - path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUlidType.php - - - - rawMessage: 'Call to an undefined static method Doctrine\DBAL\Types\ConversionException::conversionFailedInvalidType().' - identifier: staticMethod.notFound - count: 2 - path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUlidType.php - - - - rawMessage: 'Method PHPStan\Rules\Doctrine\ORM\FakeTestingSymfonyUlidType::requiresSQLCommentHint() never returns false so the return type can be changed to true.' - identifier: return.tooWideBool - count: 1 - path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUlidType.php - - - - rawMessage: 'Call to an undefined static method Doctrine\DBAL\Types\ConversionException::conversionFailed().' - identifier: staticMethod.notFound - count: 2 - path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUuidType.php - - - - rawMessage: 'Call to an undefined static method Doctrine\DBAL\Types\ConversionException::conversionFailedInvalidType().' - identifier: staticMethod.notFound - count: 2 - path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUuidType.php - - - - rawMessage: 'Method PHPStan\Rules\Doctrine\ORM\FakeTestingSymfonyUuidType::requiresSQLCommentHint() never returns false so the return type can be changed to true.' - identifier: return.tooWideBool - count: 1 - path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUuidType.php - - - - rawMessage: Accessing PHPStan\Rules\Methods\CallMethodsRule::class is not covered by backward compatibility promise. The class might change in a minor PHPStan version. + message: '#^Accessing PHPStan\\Rules\\Methods\\CallMethodsRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#' identifier: phpstanApi.classConstant count: 1 path: tests/Rules/Doctrine/ORM/MagicRepositoryMethodCallRuleTest.php - - rawMessage: Accessing PHPStan\Rules\Exceptions\CatchWithUnthrownExceptionRule::class is not covered by backward compatibility promise. The class might change in a minor PHPStan version. + message: '#^Accessing PHPStan\\Rules\\Exceptions\\CatchWithUnthrownExceptionRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#' identifier: phpstanApi.classConstant count: 1 path: tests/Rules/Exceptions/CatchWithUnthrownExceptionRuleTest.php - - rawMessage: Accessing PHPStan\Rules\Exceptions\TooWideMethodThrowTypeRule::class is not covered by backward compatibility promise. The class might change in a minor PHPStan version. + message: '#^Accessing PHPStan\\Rules\\Exceptions\\TooWideMethodThrowTypeRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#' identifier: phpstanApi.classConstant count: 1 path: tests/Rules/Exceptions/TooWideMethodThrowTypeRuleTest.php - - rawMessage: Accessing PHPStan\Rules\DeadCode\UnusedPrivatePropertyRule::class is not covered by backward compatibility promise. The class might change in a minor PHPStan version. + message: '#^Accessing PHPStan\\Rules\\DeadCode\\UnusedPrivatePropertyRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#' identifier: phpstanApi.classConstant count: 1 path: tests/Rules/Properties/MissingGedmoByPhpDocPropertyAssignRuleTest.php - - rawMessage: Accessing PHPStan\Rules\DeadCode\UnusedPrivatePropertyRule::class is not covered by backward compatibility promise. The class might change in a minor PHPStan version. + message: '#^Accessing PHPStan\\Rules\\DeadCode\\UnusedPrivatePropertyRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#' identifier: phpstanApi.classConstant count: 1 path: tests/Rules/Properties/MissingGedmoPropertyAssignRuleTest.php - - rawMessage: Accessing PHPStan\Rules\Properties\MissingReadOnlyByPhpDocPropertyAssignRule::class is not covered by backward compatibility promise. The class might change in a minor PHPStan version. + message: '#^Accessing PHPStan\\Rules\\Properties\\MissingReadOnlyByPhpDocPropertyAssignRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#' identifier: phpstanApi.classConstant count: 1 path: tests/Rules/Properties/MissingReadOnlyByPhpDocPropertyAssignRuleTest.php - - rawMessage: Accessing PHPStan\Rules\Properties\MissingReadOnlyPropertyAssignRule::class is not covered by backward compatibility promise. The class might change in a minor PHPStan version. + message: '#^Accessing PHPStan\\Rules\\Properties\\MissingReadOnlyPropertyAssignRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#' identifier: phpstanApi.classConstant count: 1 path: tests/Rules/Properties/MissingReadOnlyPropertyAssignRuleTest.php - - rawMessage: ''' - Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: - This class will be removed in 3.0 without replacement. - Copyright (c) Doctrine Project - From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + message: ''' + #^Call to method __construct\(\) of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: + This class will be removed in 3\.0 without replacement\.$# ''' identifier: method.deprecatedClass count: 1 path: tests/Rules/Properties/entity-manager.php - - rawMessage: ''' - Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: - This class will be removed in 3.0 without replacement. - Copyright (c) Doctrine Project - From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + message: ''' + #^Instantiation of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: + This class will be removed in 3\.0 without replacement\.$# ''' identifier: new.deprecatedClass count: 1 path: tests/Rules/Properties/entity-manager.php - - rawMessage: ''' - Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: - This class will be removed in 3.0 without replacement. - Copyright (c) Doctrine Project - From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + message: ''' + #^Call to method __construct\(\) of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: + This class will be removed in 3\.0 without replacement\.$# ''' identifier: method.deprecatedClass count: 1 path: tests/Type/Doctrine/DBAL/mysqli.php - - rawMessage: ''' - Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: - This class will be removed in 3.0 without replacement. - Copyright (c) Doctrine Project - From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + message: ''' + #^Instantiation of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: + This class will be removed in 3\.0 without replacement\.$# ''' identifier: new.deprecatedClass count: 1 path: tests/Type/Doctrine/DBAL/mysqli.php - - rawMessage: ''' - Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: - This class will be removed in 3.0 without replacement. - Copyright (c) Doctrine Project - From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + message: ''' + #^Call to method __construct\(\) of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: + This class will be removed in 3\.0 without replacement\.$# ''' identifier: method.deprecatedClass count: 1 path: tests/Type/Doctrine/DBAL/pdo.php - - rawMessage: ''' - Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: - This class will be removed in 3.0 without replacement. - Copyright (c) Doctrine Project - From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + message: ''' + #^Instantiation of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\: + This class will be removed in 3\.0 without replacement\.$# ''' identifier: new.deprecatedClass count: 1 path: tests/Type/Doctrine/DBAL/pdo.php + + - + message: '#^Parameter references internal interface Doctrine\\ORM\\Query\\AST\\Phase2OptimizableConditional in its type\.$#' + identifier: parameter.internalInterface + count: 2 + path: src/Type/Doctrine/Query/QueryResultTypeWalker.php From b1046e40443e8d745e4025abef9c1683784cbd33 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 21:28:44 +0200 Subject: [PATCH 3/7] Update phpstan-baseline-dbal-4.neon --- phpstan-baseline-dbal-4.neon | 159 +++++++++++++++++++++++++++-------- 1 file changed, 125 insertions(+), 34 deletions(-) diff --git a/phpstan-baseline-dbal-4.neon b/phpstan-baseline-dbal-4.neon index c1751beb..37dc2917 100644 --- a/phpstan-baseline-dbal-4.neon +++ b/phpstan-baseline-dbal-4.neon @@ -1,45 +1,70 @@ parameters: ignoreErrors: - - message: '#^Class Doctrine\\DBAL\\Types\\EnumType not found\.$#' - identifier: class.notFound + rawMessage: ''' + Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + ''' + identifier: method.deprecatedClass count: 1 - path: src/Type/Doctrine/Descriptors/EnumType.php + path: tests/Classes/entity-manager.php - - message: '#^Method PHPStan\\Type\\Doctrine\\Descriptors\\EnumType\:\:getType\(\) should return class\-string\ but returns string\.$#' - identifier: return.type + rawMessage: ''' + Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + ''' + identifier: new.deprecatedClass count: 1 - path: src/Type/Doctrine/Descriptors/EnumType.php + path: tests/Classes/entity-manager.php - - message: '#^Class Doctrine\\DBAL\\Types\\SmallFloatType not found\.$#' - identifier: class.notFound + rawMessage: ''' + Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + ''' + identifier: method.deprecatedClass count: 1 - path: src/Type/Doctrine/Descriptors/SmallFloatType.php + path: tests/DoctrineIntegration/ORM/entity-manager.php - - message: '#^Method PHPStan\\Type\\Doctrine\\Descriptors\\SmallFloatType\:\:getType\(\) should return class\-string\ but returns string\.$#' - identifier: return.type + rawMessage: ''' + Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + ''' + identifier: new.deprecatedClass count: 1 - path: src/Type/Doctrine/Descriptors/SmallFloatType.php + path: tests/DoctrineIntegration/ORM/entity-manager.php - - message: '#^Class Doctrine\\DBAL\\Types\\EnumType not found\.$#' - identifier: class.notFound + rawMessage: ''' + Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + ''' + identifier: method.deprecatedClass count: 1 - path: src/Type/Doctrine/Query/QueryResultTypeWalker.php + path: tests/Platform/QueryResultTypeWalkerFetchTypeMatrixTest.php - rawMessage: ''' - Access to constant on deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: This class will be removed in 3.0 without replacement. Copyright (c) Doctrine Project From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php ''' - identifier: classConstant.deprecatedClass + identifier: new.deprecatedClass count: 1 - path: src/Doctrine/Mapping/ClassMetadataFactory.php + path: tests/Platform/QueryResultTypeWalkerFetchTypeMatrixTest.php - rawMessage: ''' @@ -50,7 +75,7 @@ parameters: ''' identifier: method.deprecatedClass count: 1 - path: src/Doctrine/Mapping/ClassMetadataFactory.php + path: tests/Rules/DeadCode/entity-manager.php - rawMessage: ''' @@ -61,28 +86,94 @@ parameters: ''' identifier: new.deprecatedClass count: 1 - path: src/Doctrine/Mapping/ClassMetadataFactory.php + path: tests/Rules/DeadCode/entity-manager.php - - rawMessage: 'Call to an undefined static method Doctrine\DBAL\Types\ConversionException::conversionFailed().' - identifier: staticMethod.notFound - count: 2 - path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUlidType.php + rawMessage: 'Parameter #2 $type of static method Doctrine\DBAL\Types\Type::addType() expects class-string|Doctrine\DBAL\Types\Type, string given.' + identifier: argument.type + count: 1 + path: tests/Rules/Doctrine/ORM/EntityColumnRuleTest.php - - rawMessage: 'Call to an undefined static method Doctrine\DBAL\Types\ConversionException::conversionFailedInvalidType().' - identifier: staticMethod.notFound - count: 2 + rawMessage: 'Method PHPStan\Rules\Doctrine\ORM\FakeTestingRamseyUuidType::requiresSQLCommentHint() never returns false so the return type can be changed to true.' + identifier: return.tooWideBool + count: 1 + path: tests/Rules/Doctrine/ORM/FakeTestingRamseyUuidType.php + + - + rawMessage: 'Method PHPStan\Rules\Doctrine\ORM\FakeTestingSymfonyUlidType::requiresSQLCommentHint() never returns false so the return type can be changed to true.' + identifier: return.tooWideBool + count: 1 path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUlidType.php - - rawMessage: 'Call to an undefined static method Doctrine\DBAL\Types\ConversionException::conversionFailed().' - identifier: staticMethod.notFound - count: 2 + rawMessage: 'Method PHPStan\Rules\Doctrine\ORM\FakeTestingSymfonyUuidType::requiresSQLCommentHint() never returns false so the return type can be changed to true.' + identifier: return.tooWideBool + count: 1 path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUuidType.php - - rawMessage: 'Call to an undefined static method Doctrine\DBAL\Types\ConversionException::conversionFailedInvalidType().' - identifier: staticMethod.notFound - count: 2 - path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUuidType.php + rawMessage: ''' + Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + ''' + identifier: method.deprecatedClass + count: 1 + path: tests/Rules/Properties/entity-manager.php + + - + rawMessage: ''' + Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + ''' + identifier: new.deprecatedClass + count: 1 + path: tests/Rules/Properties/entity-manager.php + + - + rawMessage: ''' + Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + ''' + identifier: method.deprecatedClass + count: 1 + path: tests/Type/Doctrine/DBAL/mysqli.php + + - + rawMessage: ''' + Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + ''' + identifier: new.deprecatedClass + count: 1 + path: tests/Type/Doctrine/DBAL/mysqli.php + + - + rawMessage: ''' + Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + ''' + identifier: method.deprecatedClass + count: 1 + path: tests/Type/Doctrine/DBAL/pdo.php + + - + rawMessage: ''' + Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + ''' + identifier: new.deprecatedClass + count: 1 + path: tests/Type/Doctrine/DBAL/pdo.php From d5d459116d056cfe3c5e574d6605d73be8dec0a3 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 21:32:38 +0200 Subject: [PATCH 4/7] Update phpstan-baseline-dbal-4.neon --- phpstan-baseline-dbal-4.neon | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/phpstan-baseline-dbal-4.neon b/phpstan-baseline-dbal-4.neon index 37dc2917..06b83ac2 100644 --- a/phpstan-baseline-dbal-4.neon +++ b/phpstan-baseline-dbal-4.neon @@ -1,5 +1,35 @@ parameters: ignoreErrors: + - + message: '#^Class Doctrine\\DBAL\\Types\\EnumType not found\.$#' + identifier: class.notFound + count: 1 + path: src/Type/Doctrine/Descriptors/EnumType.php + + - + message: '#^Method PHPStan\\Type\\Doctrine\\Descriptors\\EnumType\:\:getType\(\) should return class\-string\ but returns string\.$#' + identifier: return.type + count: 1 + path: src/Type/Doctrine/Descriptors/EnumType.php + + - + message: '#^Class Doctrine\\DBAL\\Types\\SmallFloatType not found\.$#' + identifier: class.notFound + count: 1 + path: src/Type/Doctrine/Descriptors/SmallFloatType.php + + - + message: '#^Method PHPStan\\Type\\Doctrine\\Descriptors\\SmallFloatType\:\:getType\(\) should return class\-string\ but returns string\.$#' + identifier: return.type + count: 1 + path: src/Type/Doctrine/Descriptors/SmallFloatType.php + + - + message: '#^Class Doctrine\\DBAL\\Types\\EnumType not found\.$#' + identifier: class.notFound + count: 1 + path: src/Type/Doctrine/Query/QueryResultTypeWalker.php + - rawMessage: ''' Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: From 126f135d01833cbf571a6978723146461873e824 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 21:36:13 +0200 Subject: [PATCH 5/7] inline ignore tooWideBool --- phpstan-baseline-dbal-4.neon | 18 ------------------ .../Doctrine/ORM/FakeTestingRamseyUuidType.php | 2 +- .../ORM/FakeTestingSymfonyUlidType.php | 2 +- .../ORM/FakeTestingSymfonyUuidType.php | 2 +- 4 files changed, 3 insertions(+), 21 deletions(-) diff --git a/phpstan-baseline-dbal-4.neon b/phpstan-baseline-dbal-4.neon index 06b83ac2..04f789aa 100644 --- a/phpstan-baseline-dbal-4.neon +++ b/phpstan-baseline-dbal-4.neon @@ -124,24 +124,6 @@ parameters: count: 1 path: tests/Rules/Doctrine/ORM/EntityColumnRuleTest.php - - - rawMessage: 'Method PHPStan\Rules\Doctrine\ORM\FakeTestingRamseyUuidType::requiresSQLCommentHint() never returns false so the return type can be changed to true.' - identifier: return.tooWideBool - count: 1 - path: tests/Rules/Doctrine/ORM/FakeTestingRamseyUuidType.php - - - - rawMessage: 'Method PHPStan\Rules\Doctrine\ORM\FakeTestingSymfonyUlidType::requiresSQLCommentHint() never returns false so the return type can be changed to true.' - identifier: return.tooWideBool - count: 1 - path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUlidType.php - - - - rawMessage: 'Method PHPStan\Rules\Doctrine\ORM\FakeTestingSymfonyUuidType::requiresSQLCommentHint() never returns false so the return type can be changed to true.' - identifier: return.tooWideBool - count: 1 - path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUuidType.php - - rawMessage: ''' Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: diff --git a/tests/Rules/Doctrine/ORM/FakeTestingRamseyUuidType.php b/tests/Rules/Doctrine/ORM/FakeTestingRamseyUuidType.php index a81fdc64..51594f97 100644 --- a/tests/Rules/Doctrine/ORM/FakeTestingRamseyUuidType.php +++ b/tests/Rules/Doctrine/ORM/FakeTestingRamseyUuidType.php @@ -56,7 +56,7 @@ public function getName(): string return self::NAME; } - public function requiresSQLCommentHint(AbstractPlatform $platform): bool + public function requiresSQLCommentHint(AbstractPlatform $platform): bool // @phpstan-ignore return.tooWideBool { return true; } diff --git a/tests/Rules/Doctrine/ORM/FakeTestingSymfonyUlidType.php b/tests/Rules/Doctrine/ORM/FakeTestingSymfonyUlidType.php index 389303bf..bd6b87c0 100644 --- a/tests/Rules/Doctrine/ORM/FakeTestingSymfonyUlidType.php +++ b/tests/Rules/Doctrine/ORM/FakeTestingSymfonyUlidType.php @@ -100,7 +100,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?str } } - public function requiresSQLCommentHint(AbstractPlatform $platform): bool + public function requiresSQLCommentHint(AbstractPlatform $platform): bool // @phpstan-ignore return.tooWideBool { return true; } diff --git a/tests/Rules/Doctrine/ORM/FakeTestingSymfonyUuidType.php b/tests/Rules/Doctrine/ORM/FakeTestingSymfonyUuidType.php index 89d853ef..8217af22 100644 --- a/tests/Rules/Doctrine/ORM/FakeTestingSymfonyUuidType.php +++ b/tests/Rules/Doctrine/ORM/FakeTestingSymfonyUuidType.php @@ -100,7 +100,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?str } } - public function requiresSQLCommentHint(AbstractPlatform $platform): bool + public function requiresSQLCommentHint(AbstractPlatform $platform): bool // @phpstan-ignore return.tooWideBool { return true; } From 39e55e15194fc407aa47905f064dda7e862e59cd Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 21:38:08 +0200 Subject: [PATCH 6/7] Update phpstan-baseline-dbal-4.neon --- phpstan-baseline-dbal-4.neon | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/phpstan-baseline-dbal-4.neon b/phpstan-baseline-dbal-4.neon index 04f789aa..3ab7e4fe 100644 --- a/phpstan-baseline-dbal-4.neon +++ b/phpstan-baseline-dbal-4.neon @@ -189,3 +189,28 @@ parameters: identifier: new.deprecatedClass count: 1 path: tests/Type/Doctrine/DBAL/pdo.php + + - + rawMessage: 'Call to an undefined static method Doctrine\DBAL\Types\ConversionException::conversionFailed().' + identifier: staticMethod.notFound + count: 2 + path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUlidType.php + + - + rawMessage: 'Call to an undefined static method Doctrine\DBAL\Types\ConversionException::conversionFailedInvalidType().' + identifier: staticMethod.notFound + count: 2 + path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUlidType.php + + - + rawMessage: 'Call to an undefined static method Doctrine\DBAL\Types\ConversionException::conversionFailed().' + identifier: staticMethod.notFound + count: 2 + path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUuidType.php + + - + rawMessage: 'Call to an undefined static method Doctrine\DBAL\Types\ConversionException::conversionFailedInvalidType().' + identifier: staticMethod.notFound + count: 2 + path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUuidType.php + From 7a676b62612638ea8e55cd93fa7ff63b18c7e512 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 6 Oct 2025 21:40:43 +0200 Subject: [PATCH 7/7] Update phpstan-baseline-dbal-4.neon --- phpstan-baseline-dbal-4.neon | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/phpstan-baseline-dbal-4.neon b/phpstan-baseline-dbal-4.neon index 3ab7e4fe..2e0880ce 100644 --- a/phpstan-baseline-dbal-4.neon +++ b/phpstan-baseline-dbal-4.neon @@ -214,3 +214,35 @@ parameters: count: 2 path: tests/Rules/Doctrine/ORM/FakeTestingSymfonyUuidType.php + - + rawMessage: ''' + Access to constant on deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + ''' + identifier: classConstant.deprecatedClass + count: 1 + path: src/Doctrine/Mapping/ClassMetadataFactory.php + + - + rawMessage: ''' + Call to method __construct() of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + ''' + identifier: method.deprecatedClass + count: 1 + path: src/Doctrine/Mapping/ClassMetadataFactory.php + + - + rawMessage: ''' + Instantiation of deprecated class Doctrine\ORM\Mapping\Driver\AnnotationDriver: + This class will be removed in 3.0 without replacement. + Copyright (c) Doctrine Project + From https://github.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver.php + ''' + identifier: new.deprecatedClass + count: 1 + path: src/Doctrine/Mapping/ClassMetadataFactory.php