Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"gedmo/doctrine-extensions": "^3.8",
"nesbot/carbon": "^2.49",
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpstan/phpstan-deprecation-rules": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
"phpunit/phpunit": "^9.6.20",
Expand Down
127 changes: 127 additions & 0 deletions phpstan-baseline-deprecations.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
parameters:
ignoreErrors:
-
message: '''
#^Fetching class constant class of deprecated class Doctrine\\DBAL\\Types\\ArrayType\:
Use \{@link JsonType\} instead\.$#
'''
identifier: classConstant.deprecatedClass
count: 1
path: src/Type/Doctrine/Descriptors/ArrayType.php

-
message: '''
#^Fetching class constant class of deprecated class Doctrine\\DBAL\\Types\\ObjectType\:
Use \{@link JsonType\} instead\.$#
'''
identifier: classConstant.deprecatedClass
count: 1
path: src/Type/Doctrine/Descriptors/ObjectType.php

-
message: '''
#^Call to deprecated method getSchemaManager\(\) of class Doctrine\\DBAL\\Connection\:
Use \{@see createSchemaManager\(\)\} instead\.$#
'''
identifier: method.deprecated
count: 1
path: tests/Platform/QueryResultTypeWalkerFetchTypeMatrixTest.php

-
message: '''
#^Fetching class constant class of deprecated class Doctrine\\DBAL\\Types\\ArrayType\:
Use \{@link JsonType\} instead\.$#
'''
identifier: classConstant.deprecatedClass
count: 1
path: tests/Rules/Doctrine/ORM/EntityColumnRuleTest.php

-
message: '''
#^Call to deprecated method create\(\) of class Doctrine\\ORM\\EntityManager\:
Use \{@see DriverManager\:\:getConnection\(\)\} to bootstrap the connection and call the constructor\.$#
'''
identifier: staticMethod.deprecated
count: 1
path: src/Doctrine/Mapping/ClassMetadataFactory.php

-
message: '''
#^Fetching class constant class of 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

-
message: '''
#^Instantiation of deprecated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\:
This class will be removed in 3\.0 without replacement\.$#
'''
identifier: new.deprecated
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\.$#
'''
identifier: new.deprecated
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\.$#
'''
identifier: new.deprecated
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\.$#
'''
identifier: new.deprecated
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\.$#
'''
identifier: new.deprecated
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\.$#
'''
identifier: new.deprecated
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\.$#
'''
identifier: new.deprecated
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\.$#
'''
identifier: new.deprecated
count: 1
path: tests/Type/Doctrine/DBAL/pdo.php
99 changes: 99 additions & 0 deletions phpstan-baseline-orm-3.neon
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,102 @@ parameters:
message: "#^Parameter \\#2 \\$className of static method Doctrine\\\\DBAL\\\\Types\\\\Type\\:\\:addType\\(\\) expects class\\-string\\<Doctrine\\\\DBAL\\\\Types\\\\Type\\>, string given\\.$#"
count: 1
path: tests/Rules/Doctrine/ORM/EntityColumnRuleTest.php

-
message: '''
#^Fetching class constant class 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
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\.
Copyright \(c\) Doctrine Project
From https\://github\.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver\.php$#
'''
identifier: new.deprecated
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\.
Copyright \(c\) Doctrine Project
From https\://github\.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver\.php$#
'''
identifier: new.deprecated
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\.
Copyright \(c\) Doctrine Project
From https\://github\.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver\.php$#
'''
identifier: new.deprecated
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\.
Copyright \(c\) Doctrine Project
From https\://github\.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver\.php$#
'''
identifier: new.deprecated
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\.
Copyright \(c\) Doctrine Project
From https\://github\.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver\.php$#
'''
identifier: new.deprecated
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\.
Copyright \(c\) Doctrine Project
From https\://github\.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver\.php$#
'''
identifier: new.deprecated
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\.
Copyright \(c\) Doctrine Project
From https\://github\.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver\.php$#
'''
identifier: new.deprecated
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\.
Copyright \(c\) Doctrine Project
From https\://github\.com/doctrine/orm/blob/40fbbf4429b0d66517244051237a2bd0616a7a13/src/Mapping/Driver/AnnotationDriver\.php$#
'''
identifier: new.deprecated
count: 1
path: tests/Type/Doctrine/DBAL/pdo.php
2 changes: 2 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ includes:
- extension.neon
- rules.neon
- phpstan-baseline.neon
- phpstan-baseline-deprecations.neon
- phpstan-baseline-dbal-3.neon
- compatibility/orm-3-baseline.php
- vendor/phpstan/phpstan-strict-rules/rules.neon
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-phpunit/rules.neon
- phar://phpstan.phar/conf/bleedingEdge.neon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,8 @@ public function isMethodSupported(
TypeSpecifierContext $context
): bool
{
return (
$methodReflection->getDeclaringClass()->getName() === $this->collectionClass
|| $methodReflection->getDeclaringClass()->isSubclassOf($this->collectionClass)
)
&& $methodReflection->getName() === self::IS_EMPTY_METHOD_NAME;
return $methodReflection->getDeclaringClass()->is($this->collectionClass)
&& $methodReflection->getName() === self::IS_EMPTY_METHOD_NAME;
}

public function specifyTypes(
Expand Down
Loading