diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 62e3a7c837..48b5278f04 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,29 +1,5 @@ parameters: ignoreErrors: - - - message: '#^Call to an undefined method MongoDB\\Driver\\Monitoring\\CommandFailedEvent\|MongoDB\\Driver\\Monitoring\\CommandSucceededEvent\:\:getServer\(\)\.$#' - identifier: method.notFound - count: 1 - path: lib/Doctrine/ODM/MongoDB/APM/Command.php - - - - message: '#^Call to function assert\(\) with true will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 2 - path: lib/Doctrine/ODM/MongoDB/Aggregation/Aggregation.php - - - - message: '#^Instanceof between MongoDB\\Driver\\CursorInterface and Iterator will always evaluate to true\.$#' - identifier: instanceof.alwaysTrue - count: 1 - path: lib/Doctrine/ODM/MongoDB/Aggregation/Aggregation.php - - - - message: '#^Instanceof between MongoDB\\Driver\\CursorInterface and MongoDB\\Driver\\CursorInterface will always evaluate to true\.$#' - identifier: instanceof.alwaysTrue - count: 1 - path: lib/Doctrine/ODM/MongoDB/Aggregation/Aggregation.php - - message: '#^Method Doctrine\\ODM\\MongoDB\\Aggregation\\Aggregation\:\:__construct\(\) has parameter \$classMetadata with generic class Doctrine\\ODM\\MongoDB\\Mapping\\ClassMetadata but does not specify its types\: T$#' identifier: missingType.generics @@ -1116,36 +1092,12 @@ parameters: count: 1 path: lib/Doctrine/ODM/MongoDB/Persisters/CollectionPersister.php - - - message: '#^Call to function assert\(\) with true will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 2 - path: lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php - - message: '#^Call to function is_array\(\) with array will always evaluate to true\.$#' identifier: function.alreadyNarrowedType count: 1 path: lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php - - - message: '#^Instanceof between MongoDB\\Collection and MongoDB\\Collection will always evaluate to true\.$#' - identifier: instanceof.alwaysTrue - count: 1 - path: lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php - - - - message: '#^Instanceof between MongoDB\\Driver\\CursorInterface and Iterator will always evaluate to true\.$#' - identifier: instanceof.alwaysTrue - count: 1 - path: lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php - - - - message: '#^Instanceof between MongoDB\\Driver\\CursorInterface and MongoDB\\Driver\\CursorInterface will always evaluate to true\.$#' - identifier: instanceof.alwaysTrue - count: 1 - path: lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php - - message: '#^Method Doctrine\\ODM\\MongoDB\\Persisters\\DocumentPersister\:\:createReferenceManyInverseSideQuery\(\) has parameter \$collection with generic interface Doctrine\\ODM\\MongoDB\\PersistentCollection\\PersistentCollectionInterface but does not specify its types\: TKey, T$#' identifier: missingType.generics @@ -1236,12 +1188,6 @@ parameters: count: 1 path: lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php - - - message: '#^Result of && is always true\.$#' - identifier: booleanAnd.alwaysTrue - count: 1 - path: lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php - - message: '#^Call to an undefined static method Doctrine\\ODM\\MongoDB\\Proxy\\Factory\\LazyGhostProxyFactory\:\:createLazyGhost\(\)\.$#' identifier: staticMethod.notFound @@ -1596,18 +1542,6 @@ parameters: count: 3 path: tests/Doctrine/ODM/MongoDB/Tests/Functional/CollectionPersisterTest.php - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Functional\\CustomDatabaseTest\:\:\$id is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/DatabasesTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Functional\\DefaultDatabaseTest\:\:\$id is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/DatabasesTest.php - - message: '#^PHPDoc type Doctrine\\Common\\Collections\\Collection\ of property Doctrine\\ODM\\MongoDB\\Tests\\Functional\\ParentDocumentWithDiscriminator\:\:\$embeddedChildren is not covariant with PHPDoc type array\\|Doctrine\\Common\\Collections\\Collection\ of overridden property Doctrine\\ODM\\MongoDB\\Tests\\Functional\\ParentDocument\:\:\$embeddedChildren\.$#' identifier: property.phpDocType @@ -1632,42 +1566,12 @@ parameters: count: 1 path: tests/Doctrine/ODM/MongoDB/Tests/Functional/DiscriminatorsDefaultValueTest.php - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Functional\\DocumentPersisterTestDocumentWithReferenceToDocumentWithCustomId\:\:\$documentWithCustomId is never read, only written\.$#' - identifier: property.onlyWritten - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/DocumentPersisterTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Functional\\DocumentPersisterTestDocumentWithReferenceToDocumentWithCustomId\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/DocumentPersisterTest.php - - message: '#^Expression "\$groups\[0\]" on a separate line does not do anything\.$#' identifier: expr.resultUnused count: 1 path: tests/Doctrine/ODM/MongoDB/Tests/Functional/FunctionalTest.php - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Functional\\ChildObject\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/LifecycleTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Functional\\ParentObject\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/LifecycleTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Functional\\Hierarchy\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/NestedDocumentsTest.php - - message: '#^Access to an undefined property MongoDB\\Model\\BSONDocument\:\:\$patientId\.$#' identifier: property.notFound @@ -1698,216 +1602,6 @@ parameters: count: 1 path: tests/Doctrine/ODM/MongoDB/Tests/Functional/TargetDocumentTest.php - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Functional\\Ticket\\GH1058PersistDocument\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH1058Test.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Functional\\Ticket\\GH1058PersistDocument\:\:\$value is never read, only written\.$#' - identifier: property.onlyWritten - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH1058Test.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Functional\\Ticket\\GH1058UpsertDocument\:\:\$value is never read, only written\.$#' - identifier: property.onlyWritten - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH1058Test.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Functional\\Ticket\\GH1964Document\:\:\$id is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH1964Test.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Functional\\Ticket\\GH1990Document\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH1990Test.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Functional\\Ticket\\GH1990Document\:\:\$parent is never read, only written\.$#' - identifier: property.onlyWritten - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH1990Test.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Functional\\Ticket\\GH921Post\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH921Test.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Functional\\Ticket\\GH921User\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH921Test.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Functional\\Ticket\\GH999Document\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH999Test.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Functional\\Ticket\\MODM116Parent\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/MODM116Test.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\AnnotationDriverTestSuper\:\:\$private is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/AbstractAnnotationDriverTestCase.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\DocumentSubClass2\:\:\$id is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\DocumentSubClass2\:\:\$name is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\DocumentSubClass\:\:\$id is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\DocumentSubClass\:\:\$name is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\GridFSChildClass\:\:\$id is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\GridFSParentClass\:\:\$id is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\MappedSuperclassBase\:\:\$mapped1 is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\MappedSuperclassBase\:\:\$mapped2 is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\MappedSuperclassBase\:\:\$mappedRelated1 is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\MappedSuperclassBase\:\:\$transient is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\MappedSuperclassRelated1\:\:\$id is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\MappedSuperclassRelated1\:\:\$name is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\TransientBaseClass\:\:\$transient1 is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\TransientBaseClass\:\:\$transient2 is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\LoadEventTestDocument\:\:\$about is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/ClassMetadataLoadEventTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\LoadEventTestDocument\:\:\$id is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/ClassMetadataLoadEventTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\LoadEventTestDocument\:\:\$name is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/ClassMetadataLoadEventTest.php - - - - message: '#^Property DoctrineGlobal_User\:\:\$email is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/Documents/GlobalNamespaceDocument.php - - - - message: '#^Property DoctrineGlobal_User\:\:\$id is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/Documents/GlobalNamespaceDocument.php - - - - message: '#^Property DoctrineGlobal_User\:\:\$username is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/Documents/GlobalNamespaceDocument.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\ShardedCollectionPerClass1\:\:\$id is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/ShardKeyInheritanceMappingTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\ShardedSingleCollInheritance1\:\:\$id is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/ShardKeyInheritanceMappingTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\ShardedSubclass\:\:\$id is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/ShardKeyInheritanceMappingTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\ShardedSuperclass\:\:\$name is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/ShardKeyInheritanceMappingTest.php - - message: '#^Method Doctrine\\ODM\\MongoDB\\Tests\\Query\\BuilderTest\:\:testExclude\(\) has parameter \$expected with no value type specified in iterable type array\.$#' identifier: missingType.iterableValue @@ -2052,290 +1746,8 @@ parameters: count: 1 path: tests/Doctrine/ODM/MongoDB/Tests/Tools/EncryptedFieldsMapGeneratorTest.php - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Tools\\GH297\\User\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Tools/GH297/User.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Tools\\ResolveTargetDocument\:\:\$embedMany is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Tools/ResolveTargetDocumentListenerTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Tools\\ResolveTargetDocument\:\:\$embedOne is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Tools/ResolveTargetDocumentListenerTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Tools\\ResolveTargetDocument\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Tools/ResolveTargetDocumentListenerTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Tools\\ResolveTargetDocument\:\:\$refMany is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Tools/ResolveTargetDocumentListenerTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Tools\\ResolveTargetDocument\:\:\$refOne is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Tools/ResolveTargetDocumentListenerTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Tools\\TargetDocument\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Tools/ResolveTargetDocumentListenerTest.php - - - - message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\ArrayTest\:\:\$id is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/UnitOfWorkTest.php - - - - message: '#^Property Documents\\Account\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/Account.php - - - - message: '#^Property Documents\\Address\:\:\$test is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Documents/Address.php - - - - message: '#^Property Documents\\Album\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/Album.php - - - - message: '#^Property Documents\\Article\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/Article.php - - - - message: '#^Property Documents\\Bars\\Bar\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/Bars/Bar.php - - - - message: '#^Property Documents\\Category\:\:\$id is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Documents/Category.php - - - - message: '#^Property Documents\\Developer\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/Developer.php - - - - message: '#^Property Documents\\Developer\:\:\$name is never read, only written\.$#' - identifier: property.onlyWritten - count: 1 - path: tests/Documents/Developer.php - - - - message: '#^Property Documents\\Ecommerce\\StockItem\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/Ecommerce/StockItem.php - - message: '#^Method Documents\\Encryption\\Client\:\:__construct\(\) has parameter \$clientCards with generic interface Doctrine\\Common\\Collections\\Collection but does not specify its types\: TKey, T$#' identifier: missingType.generics count: 1 path: tests/Documents/Encryption/Client.php - - - - message: '#^Property Documents\\Event\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/Event.php - - - - message: '#^Property Documents\\File\:\:\$chunkSize is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/File.php - - - - message: '#^Property Documents\\File\:\:\$filename is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/File.php - - - - message: '#^Property Documents\\File\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/File.php - - - - message: '#^Property Documents\\File\:\:\$length is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/File.php - - - - message: '#^Property Documents\\File\:\:\$uploadDate is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/File.php - - - - message: '#^Property Documents\\FileWithoutChunkSize\:\:\$chunkSize is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/FileWithoutChunkSize.php - - - - message: '#^Property Documents\\FileWithoutChunkSize\:\:\$filename is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/FileWithoutChunkSize.php - - - - message: '#^Property Documents\\FileWithoutChunkSize\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/FileWithoutChunkSize.php - - - - message: '#^Property Documents\\FileWithoutChunkSize\:\:\$length is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/FileWithoutChunkSize.php - - - - message: '#^Property Documents\\FileWithoutChunkSize\:\:\$uploadDate is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/FileWithoutChunkSize.php - - - - message: '#^Property Documents\\FileWithoutMetadata\:\:\$filename is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/FileWithoutMetadata.php - - - - message: '#^Property Documents\\FileWithoutMetadata\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/FileWithoutMetadata.php - - - - message: '#^Property Documents\\Functional\\FavoritesUser\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/Functional/FavoritesUser.php - - - - message: '#^Property Documents\\Group\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/Group.php - - - - message: '#^Property Documents\\Message\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/Message.php - - - - message: '#^Property Documents\\ProfileNotify\:\:\$profileId is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/ProfileNotify.php - - - - message: '#^Property Documents\\Project\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/Project.php - - - - message: '#^Property Documents\\SchemaValidated\:\:\$email is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Documents/SchemaValidated.php - - - - message: '#^Property Documents\\SchemaValidated\:\:\$id is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Documents/SchemaValidated.php - - - - message: '#^Property Documents\\SchemaValidated\:\:\$name is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Documents/SchemaValidated.php - - - - message: '#^Property Documents\\SchemaValidated\:\:\$phone is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Documents/SchemaValidated.php - - - - message: '#^Property Documents\\SchemaValidated\:\:\$status is unused\.$#' - identifier: property.unused - count: 1 - path: tests/Documents/SchemaValidated.php - - - - message: '#^Property Documents\\Task\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/Task.php - - - - message: '#^Property Documents\\Tournament\\Participant\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/Tournament/Participant.php - - - - message: '#^Property Documents\\Tournament\\Tournament\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/Tournament/Tournament.php - - - - message: '#^Property Documents\\UserName\:\:\$id is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/UserName.php - - - - message: '#^Property Documents\\UserName\:\:\$username is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/UserName.php - - - - message: '#^Property Documents\\UserName\:\:\$viewReference is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/UserName.php - - - - message: '#^Property Documents\\ViewReference\:\:\$referenceOneViewMappedBy is never written, only read\.$#' - identifier: property.onlyRead - count: 1 - path: tests/Documents/ViewReference.php diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 2c2c3e1985..c0a69375c6 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -33,6 +33,23 @@ parameters: identifier: constant.notFound path: tests/ + # Unused properties from test document classes + - message: '#^Property (DoctrineGlobal_|Documents\\|Doctrine\\ODM\\MongoDB\\Tests\\)[^:]+(?dm->getDocumentDatabase(CustomDatabaseTest::class)->getDatabaseName()); + self::assertEquals('test_custom', $this->dm->getDocumentDatabase(TestCustomDatabase::class)->getDatabaseName()); } public function testDefaultDatabase(): void { - self::assertEquals('test_default', $this->dm->getDocumentDatabase(DefaultDatabaseTest::class)->getDatabaseName()); + self::assertEquals('test_default', $this->dm->getDocumentDatabase(TestDefaultDatabase::class)->getDatabaseName()); } protected static function getConfiguration(): Configuration @@ -31,7 +31,7 @@ protected static function getConfiguration(): Configuration } #[ODM\Document(db: 'test_custom')] -class CustomDatabaseTest +class TestCustomDatabase { /** @var string|null */ #[ODM\Id] @@ -39,7 +39,7 @@ class CustomDatabaseTest } #[ODM\Document] -class DefaultDatabaseTest +class TestDefaultDatabase { /** @var string|null */ #[ODM\Id] diff --git a/tests/Doctrine/ODM/MongoDB/Tests/UnitOfWorkTest.php b/tests/Doctrine/ODM/MongoDB/Tests/UnitOfWorkTest.php index ac065a8ded..55d61fedba 100644 --- a/tests/Doctrine/ODM/MongoDB/Tests/UnitOfWorkTest.php +++ b/tests/Doctrine/ODM/MongoDB/Tests/UnitOfWorkTest.php @@ -257,7 +257,7 @@ public function testComputingChangesetForFileWithoutMetadataThrowsNoError(): voi #[DataProvider('getScheduleForUpdateWithArraysTests')] public function testScheduleForUpdateWithArrays(?array $origData, ?array $updateData, bool $shouldInUpdate): void { - $arrayTest = new ArrayTest($origData); + $arrayTest = new ArrayDocument($origData); $this->uow->persist($arrayTest); $this->uow->computeChangeSets(); $this->uow->commit(); @@ -701,7 +701,7 @@ public function setOwner(NotifyChangedDocument $owner): void } #[ODM\Document] -class ArrayTest +class ArrayDocument { /** @var string|null */ #[ODM\Id]