Skip to content

Commit

Permalink
Flip conditional extension of legacy AnnotationDriver class (doctrine…
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus authored Jun 13, 2022
1 parent 33d74e2 commit eff540a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@

use function class_exists;

if (class_exists(PersistenceAnnotationDriver::class)) {
if (! class_exists(PersistenceAnnotationDriver::class)) {
/**
* @internal This class will be removed in ORM 3.0.
*/
abstract class CompatibilityAnnotationDriver extends PersistenceAnnotationDriver
abstract class CompatibilityAnnotationDriver implements MappingDriver
{
}
} else {
/**
* @internal This class will be removed in ORM 3.0.
*/
abstract class CompatibilityAnnotationDriver implements MappingDriver
abstract class CompatibilityAnnotationDriver extends PersistenceAnnotationDriver
{
}
}
3 changes: 0 additions & 3 deletions phpstan-dbal2.neon
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ parameters:
message: '#^Call to method injectObjectManager\(\) on an unknown class Doctrine\\Persistence\\ObjectManagerAware\.$#'
path: lib/Doctrine/ORM/UnitOfWork.php

# https://github.com/phpstan/phpstan/issues/7290
- '#expects Doctrine\\Persistence\\Mapping\\Driver\\MappingDriver, Doctrine\\ORM\\Mapping\\Driver\\(Annotation|Attribute)Driver given#'

# https://github.com/phpstan/phpstan/issues/7292
-
message: '#^Offset class\-string on array\<class\-string, array\<string, mixed\>\> in isset\(\) always exists and is not nullable\.$#'
Expand Down
11 changes: 0 additions & 11 deletions phpstan-persistence2.neon
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,6 @@ parameters:
# Symfony cache supports passing a key prefix to the clear method.
- '/^Method Psr\\Cache\\CacheItemPoolInterface\:\:clear\(\) invoked with 1 parameter, 0 required\.$/'

# Compatibility layer for AttributeDriver
-
message: "#^PHPDoc type Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AttributeReader of property Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AttributeDriver\\:\\:\\$reader is not covariant with PHPDoc type Doctrine\\\\Common\\\\Annotations\\\\Reader of overridden property Doctrine\\\\Persistence\\\\Mapping\\\\Driver\\\\AnnotationDriver\\:\\:\\$reader\\.$#"
path: lib/Doctrine/ORM/Mapping/Driver/AttributeDriver.php
-
message: "#^PHPDoc type array\\<string, int\\> of property Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AttributeDriver\\:\\:\\$entityAnnotationClasses is not covariant with PHPDoc type array\\<class\\-string, bool\\|int\\> of overridden property Doctrine\\\\Persistence\\\\Mapping\\\\Driver\\\\AnnotationDriver\\:\\:\\$entityAnnotationClasses\\.$#"
path: lib/Doctrine/ORM/Mapping/Driver/AttributeDriver.php
-
message: "#^Return type \\(Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AttributeReader\\) of method Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AttributeDriver\\:\\:getReader\\(\\) should be compatible with return type \\(Doctrine\\\\Common\\\\Annotations\\\\Reader\\) of method Doctrine\\\\Persistence\\\\Mapping\\\\Driver\\\\AnnotationDriver\\:\\:getReader\\(\\)$#"
path: lib/Doctrine/ORM/Mapping/Driver/AttributeDriver.php

# https://github.com/phpstan/phpstan/issues/7292
-
message: '#^Offset class\-string on array\<class\-string, array\<string, mixed\>\> in isset\(\) always exists and is not nullable\.$#'
Expand Down
3 changes: 0 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ parameters:
message: '#^Call to method injectObjectManager\(\) on an unknown class Doctrine\\Persistence\\ObjectManagerAware\.$#'
path: lib/Doctrine/ORM/UnitOfWork.php

# https://github.com/phpstan/phpstan/issues/7290
- '#expects Doctrine\\Persistence\\Mapping\\Driver\\MappingDriver, Doctrine\\ORM\\Mapping\\Driver\\(Annotation|Attribute)Driver given#'

# https://github.com/phpstan/phpstan/issues/7292
-
message: '#^Offset class\-string on array\<class\-string, array\<string, mixed\>\> in isset\(\) always exists and is not nullable\.$#'
Expand Down

0 comments on commit eff540a

Please sign in to comment.