diff --git a/composer.json b/composer.json index 0dc4e2970e..287f680204 100644 --- a/composer.json +++ b/composer.json @@ -60,11 +60,11 @@ "doctrine/orm": "^2.14.0 || ^3.0", "friendsofphp/php-cs-fixer": "^3.14.0", "nesbot/carbon": "^2.71 || ^3.0", - "phpstan/phpstan": "^1.11", - "phpstan/phpstan-doctrine": "^1.4", - "phpstan/phpstan-phpunit": "^1.4", + "phpstan/phpstan": "^2.0.3", + "phpstan/phpstan-doctrine": "^2.0.1", + "phpstan/phpstan-phpunit": "^2.0.1", "phpunit/phpunit": "^9.6", - "rector/rector": "^1.1", + "rector/rector": "^2.0@rc", "symfony/console": "^5.4 || ^6.0 || ^7.0", "symfony/doctrine-bridge": "^5.4 || ^6.0 || ^7.0", "symfony/phpunit-bridge": "^6.0 || ^7.0", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 83d8455f98..a5fd58ccdf 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,917 +1,1250 @@ parameters: ignoreErrors: - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:getReflectionProperty\\(\\)\\.$#" - count: 1 - path: src/AbstractTrackingListener.php - - - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:getReflectionProperty\\(\\)\\.$#" - count: 3 + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getReflectionProperty\(\)\.$#' + identifier: method.notFound + count: 4 path: src/AbstractTrackingListener.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getUnitOfWork\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\ObjectManager\:\:getUnitOfWork\(\)\.$#' + identifier: method.notFound count: 3 path: src/AbstractTrackingListener.php - - message: "#^Access to offset 'inherited' on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\AssociationFieldMapping\\.$#" + message: '#^Access to offset ''inherited'' on an unknown class Doctrine\\ODM\\MongoDB\\Mapping\\AssociationFieldMapping\.$#' + identifier: class.notFound count: 1 path: src/Blameable/Mapping/Driver/Attribute.php - - message: "#^Property Gedmo\\\\Mapping\\\\Annotation\\\\Blameable\\:\\:\\$field \\(array\\\\|string\\) in isset\\(\\) is not nullable\\.$#" + message: '#^Property Gedmo\\Mapping\\Annotation\\Blameable\:\:\$field \(array\\|string\) in isset\(\) is not nullable\.$#' + identifier: isset.property count: 1 path: src/Blameable/Mapping/Driver/Attribute.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:getFieldMapping\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getFieldMapping\(\)\.$#' + identifier: method.notFound count: 1 path: src/Blameable/Mapping/Driver/Xml.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:getFieldMapping\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getFieldMapping\(\)\.$#' + identifier: method.notFound count: 1 path: src/Blameable/Mapping/Driver/Yaml.php - - message: "#^Instantiated class Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AnnotationDriver not found\\.$#" + message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#' + identifier: class.notFound count: 2 path: src/DoctrineExtensions.php - - message: "#^Access to offset 'inherited' on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\AssociationFieldMapping\\.$#" + message: '#^Access to offset ''inherited'' on an unknown class Doctrine\\ODM\\MongoDB\\Mapping\\AssociationFieldMapping\.$#' + identifier: class.notFound count: 1 path: src/IpTraceable/Mapping/Driver/Attribute.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:getFieldMapping\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getFieldMapping\(\)\.$#' + identifier: method.notFound count: 1 path: src/IpTraceable/Mapping/Driver/Xml.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:getFieldMapping\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getFieldMapping\(\)\.$#' + identifier: method.notFound count: 1 path: src/IpTraceable/Mapping/Driver/Yaml.php - - message: "#^Unable to resolve the template type T in call to method Doctrine\\\\ORM\\\\EntityManagerInterface\\:\\:getReference\\(\\)$#" + message: '#^Method Gedmo\\Loggable\\Entity\\Repository\\LogEntryRepository\:\:getLogEntriesQuery\(\) return type with generic class Doctrine\\ORM\\Query does not specify its types\: TKey, TResult$#' + identifier: missingType.generics + count: 1 + path: src/Loggable/Entity/Repository/LogEntryRepository.php + + - + message: '#^Unable to resolve the template type T in call to method Doctrine\\ORM\\EntityManagerInterface\:\:getReference\(\)$#' + identifier: argument.templateType count: 1 path: src/Loggable/Entity/Repository/LogEntryRepository.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\>\\:\\:getReflectionProperty\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\>\:\:getReflectionProperty\(\)\.$#' + identifier: method.notFound count: 1 path: src/Loggable/LoggableListener.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\>\\:\\:newInstance\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\>\:\:newInstance\(\)\.$#' + identifier: method.notFound count: 1 path: src/Loggable/LoggableListener.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getUnitOfWork\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\ObjectManager\:\:getUnitOfWork\(\)\.$#' + identifier: method.notFound count: 4 path: src/Loggable/LoggableListener.php - - message: "#^Method Gedmo\\\\Tool\\\\WrapperInterface\\\\:\\:getIdentifier\\(\\) invoked with 2 parameters, 0\\-1 required\\.$#" + message: '#^Method Gedmo\\Tool\\WrapperInterface\,object,Doctrine\\Persistence\\ObjectManager\>\:\:getIdentifier\(\) invoked with 2 parameters, 0\-1 required\.$#' + identifier: arguments.count count: 2 path: src/Loggable/LoggableListener.php - - message: "#^Access to an undefined property Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:\\$associationMappings\\.$#" + message: '#^Access to an undefined property Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:\$associationMappings\.$#' + identifier: property.notFound count: 1 path: src/Loggable/Mapping/Driver/Xml.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:getFieldMapping\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getFieldMapping\(\)\.$#' + identifier: method.notFound count: 1 path: src/Mapping/Driver/AbstractAnnotationDriver.php - - message: "#^Call to an undefined method Doctrine\\\\Common\\\\EventArgs\\:\\:getDocument\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Common\\EventArgs\:\:getDocument\(\)\.$#' + identifier: method.notFound count: 1 path: src/Mapping/Event/Adapter/ODM.php - - message: "#^Call to an undefined method Doctrine\\\\Common\\\\EventArgs\\:\\:getDocumentManager\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Common\\EventArgs\:\:getDocumentManager\(\)\.$#' + identifier: method.notFound count: 1 path: src/Mapping/Event/Adapter/ODM.php - - message: "#^Call to an undefined method Doctrine\\\\Common\\\\EventArgs\\:\\:getEntity\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Common\\EventArgs\:\:getEntity\(\)\.$#' + identifier: method.notFound count: 1 path: src/Mapping/Event/Adapter/ORM.php - - message: "#^Call to an undefined method Doctrine\\\\Common\\\\EventArgs\\:\\:getEntityManager\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Common\\EventArgs\:\:getEntityManager\(\)\.$#' + identifier: method.notFound count: 1 path: src/Mapping/Event/Adapter/ORM.php - - message: "#^Method Gedmo\\\\Mapping\\\\Event\\\\Adapter\\\\ORM\\:\\:createLifecycleEventArgsInstance\\(\\) has invalid return type Doctrine\\\\ORM\\\\Event\\\\LifecycleEventArgs\\.$#" + message: '#^Method Gedmo\\Mapping\\Event\\Adapter\\ORM\:\:createLifecycleEventArgsInstance\(\) has invalid return type Doctrine\\ORM\\Event\\LifecycleEventArgs\.$#' + identifier: class.notFound count: 1 path: src/Mapping/Event/Adapter/ORM.php - - message: "#^Access to property \\$isMappedSuperclass on an unknown class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadataInfo\\.$#" + message: '#^Access to property \$isMappedSuperclass on an unknown class Doctrine\\ORM\\Mapping\\ClassMetadataInfo\.$#' + identifier: class.notFound count: 1 path: src/Mapping/ExtensionMetadataFactory.php - - message: "#^Access to property \\$parentClasses on an unknown class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadataInfo\\.$#" + message: '#^Access to property \$parentClasses on an unknown class Doctrine\\ORM\\Mapping\\ClassMetadataInfo\.$#' + identifier: class.notFound count: 1 path: src/Mapping/ExtensionMetadataFactory.php - - message: "#^Access to property \\$reflClass on an unknown class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadataInfo\\.$#" + message: '#^Access to property \$reflClass on an unknown class Doctrine\\ORM\\Mapping\\ClassMetadataInfo\.$#' + identifier: class.notFound count: 1 path: src/Mapping/ExtensionMetadataFactory.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\Driver\\\\MappingDriver\\:\\:getDefaultDriver\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\Driver\\MappingDriver\:\:getDefaultDriver\(\)\.$#' + identifier: method.notFound count: 2 path: src/Mapping/ExtensionMetadataFactory.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\Driver\\\\MappingDriver\\:\\:getDrivers\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\Driver\\MappingDriver\:\:getDrivers\(\)\.$#' + identifier: method.notFound count: 1 path: src/Mapping/ExtensionMetadataFactory.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\Driver\\\\MappingDriver\\:\\:getLocator\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\Driver\\MappingDriver\:\:getLocator\(\)\.$#' + identifier: method.notFound count: 1 path: src/Mapping/ExtensionMetadataFactory.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getConfiguration\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\ObjectManager\:\:getConfiguration\(\)\.$#' + identifier: method.notFound count: 1 path: src/Mapping/ExtensionMetadataFactory.php - - message: "#^Call to method getName\\(\\) on an unknown class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadataInfo\\.$#" + message: '#^Call to method getName\(\) on an unknown class Doctrine\\ORM\\Mapping\\ClassMetadataInfo\.$#' + identifier: class.notFound count: 4 path: src/Mapping/ExtensionMetadataFactory.php - - message: "#^Call to method isInheritanceTypeNone\\(\\) on an unknown class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadataInfo\\.$#" + message: '#^Call to method isInheritanceTypeNone\(\) on an unknown class Doctrine\\ORM\\Mapping\\ClassMetadataInfo\.$#' + identifier: class.notFound count: 1 path: src/Mapping/ExtensionMetadataFactory.php - - message: "#^Class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadataInfo not found\\.$#" + message: '#^Class Doctrine\\ORM\\Mapping\\ClassMetadataInfo not found\.$#' + identifier: class.notFound count: 1 path: src/Mapping/ExtensionMetadataFactory.php - - message: "#^Parameter \\$meta of method Gedmo\\\\Mapping\\\\ExtensionMetadataFactory\\:\\:getExtensionMetadata\\(\\) has invalid type Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadataInfo\\.$#" + message: '#^Parameter \$meta of method Gedmo\\Mapping\\ExtensionMetadataFactory\:\:getExtensionMetadata\(\) has invalid type Doctrine\\ORM\\Mapping\\ClassMetadataInfo\.$#' + identifier: class.notFound count: 1 path: src/Mapping/ExtensionMetadataFactory.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:getReflectionProperty\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getReflectionProperty\(\)\.$#' + identifier: method.notFound count: 1 path: src/Mapping/MappedEventSubscriber.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getUnitOfWork\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\ObjectManager\:\:getUnitOfWork\(\)\.$#' + identifier: method.notFound count: 1 path: src/Mapping/MappedEventSubscriber.php - - message: "#^Call to method getName\\(\\) on an unknown class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadataInfo\\.$#" + message: '#^Call to method getName\(\) on an unknown class Doctrine\\ORM\\Mapping\\ClassMetadataInfo\.$#' + identifier: class.notFound count: 1 path: src/Mapping/MappedEventSubscriber.php - - message: "#^Class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadataInfo not found\\.$#" + message: '#^Class Doctrine\\ORM\\Mapping\\ClassMetadataInfo not found\.$#' + identifier: class.notFound count: 1 path: src/Mapping/MappedEventSubscriber.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:getFieldMapping\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getFieldMapping\(\)\.$#' + identifier: method.notFound count: 1 path: src/ReferenceIntegrity/ReferenceIntegrityListener.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:getReflectionProperty\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getReflectionProperty\(\)\.$#' + identifier: method.notFound count: 3 path: src/ReferenceIntegrity/ReferenceIntegrityListener.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:isCollectionValuedReference\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:isCollectionValuedReference\(\)\.$#' + identifier: method.notFound count: 4 path: src/ReferenceIntegrity/ReferenceIntegrityListener.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:isSingleValuedReference\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:isSingleValuedReference\(\)\.$#' + identifier: method.notFound count: 1 path: src/ReferenceIntegrity/ReferenceIntegrityListener.php - - message: "#^Access to offset 'inherited' on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\AssociationFieldMapping\\.$#" + message: '#^Access to offset ''inherited'' on an unknown class Doctrine\\ODM\\MongoDB\\Mapping\\AssociationFieldMapping\.$#' + identifier: class.notFound count: 1 path: src/References/Mapping/Driver/Attribute.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:getReflectionProperty\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getReflectionProperty\(\)\.$#' + identifier: method.notFound count: 1 path: src/References/Mapping/Event/Adapter/ODM.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:isInheritanceTypeNone\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:isInheritanceTypeNone\(\)\.$#' + identifier: method.notFound count: 1 path: src/References/Mapping/Event/Adapter/ODM.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getReference\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\ObjectManager\:\:getReference\(\)\.$#' + identifier: method.notFound count: 1 path: src/References/Mapping/Event/Adapter/ODM.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getUnitOfWork\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\ObjectManager\:\:getUnitOfWork\(\)\.$#' + identifier: method.notFound count: 1 path: src/References/Mapping/Event/Adapter/ODM.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:getReflectionProperty\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getReflectionProperty\(\)\.$#' + identifier: method.notFound count: 2 path: src/References/Mapping/Event/Adapter/ORM.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:isInheritanceTypeNone\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:isInheritanceTypeNone\(\)\.$#' + identifier: method.notFound count: 1 path: src/References/Mapping/Event/Adapter/ORM.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getUnitOfWork\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\ObjectManager\:\:getUnitOfWork\(\)\.$#' + identifier: method.notFound count: 1 path: src/References/Mapping/Event/Adapter/ORM.php - - message: "#^Call to method getClassMetadata\\(\\) on an unknown class Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManager\\.$#" + message: '#^Call to method getClassMetadata\(\) on an unknown class Doctrine\\ODM\\PHPCR\\DocumentManager\.$#' + identifier: class.notFound count: 2 path: src/References/Mapping/Event/Adapter/ORM.php - - message: "#^Call to method getReference\\(\\) on an unknown class Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManager\\.$#" + message: '#^Call to method getReference\(\) on an unknown class Doctrine\\ODM\\PHPCR\\DocumentManager\.$#' + identifier: class.notFound count: 1 path: src/References/Mapping/Event/Adapter/ORM.php - - message: "#^Class Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManager not found\\.$#" + message: '#^Class Doctrine\\ODM\\PHPCR\\DocumentManager not found\.$#' + identifier: class.notFound count: 2 path: src/References/Mapping/Event/Adapter/ORM.php - - message: "#^Access to an undefined property Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:\\$reflClass\\.$#" + message: '#^PHPDoc tag @phpstan\-assert for \$dm contains unknown class Doctrine\\ODM\\PHPCR\\DocumentManager\.$#' + identifier: class.notFound + count: 1 + path: src/References/Mapping/Event/Adapter/ORM.php + + - + message: '#^Access to an undefined property Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:\$reflClass\.$#' + identifier: property.notFound count: 4 path: src/References/ReferencesListener.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:getFieldValue\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getFieldValue\(\)\.$#' + identifier: method.notFound count: 1 path: src/References/ReferencesListener.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:setFieldValue\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:setFieldValue\(\)\.$#' + identifier: method.notFound count: 1 path: src/References/ReferencesListener.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:getReflectionProperty\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getReflectionProperty\(\)\.$#' + identifier: method.notFound count: 2 path: src/Sluggable/Handler/InversedRelativeSlugHandler.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getUnitOfWork\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\ObjectManager\:\:getUnitOfWork\(\)\.$#' + identifier: method.notFound count: 2 path: src/Sluggable/Handler/InversedRelativeSlugHandler.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getUnitOfWork\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\ObjectManager\:\:getUnitOfWork\(\)\.$#' + identifier: method.notFound count: 2 path: src/Sluggable/Handler/RelativeSlugHandler.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:getReflectionProperty\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getReflectionProperty\(\)\.$#' + identifier: method.notFound count: 2 path: src/Sluggable/Handler/TreeSlugHandler.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getUnitOfWork\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\ObjectManager\:\:getUnitOfWork\(\)\.$#' + identifier: method.notFound count: 3 path: src/Sluggable/Handler/TreeSlugHandler.php - - message: "#^Access to offset 'inherited' on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\AssociationFieldMapping\\.$#" + message: '#^Access to offset ''inherited'' on an unknown class Doctrine\\ODM\\MongoDB\\Mapping\\AssociationFieldMapping\.$#' + identifier: class.notFound count: 1 path: src/Sluggable/Mapping/Driver/Attribute.php - - message: "#^Access to an undefined property Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:\\$isMappedSuperclass\\.$#" + message: '#^Access to an undefined property Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:\$isMappedSuperclass\.$#' + identifier: property.notFound count: 1 path: src/Sluggable/Mapping/Driver/Xml.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:getFieldMapping\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getFieldMapping\(\)\.$#' + identifier: method.notFound count: 1 path: src/Sluggable/Mapping/Driver/Xml.php - - message: "#^Access to an undefined property Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:\\$isMappedSuperclass\\.$#" + message: '#^Access to an undefined property Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:\$isMappedSuperclass\.$#' + identifier: property.notFound count: 1 path: src/Sluggable/Mapping/Driver/Yaml.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:getFieldMapping\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getFieldMapping\(\)\.$#' + identifier: method.notFound count: 1 path: src/Sluggable/Mapping/Driver/Yaml.php - - message: "#^Call to method getFieldName\\(\\) on an unknown class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadataInfo\\.$#" + message: '#^Call to method getFieldName\(\) on an unknown class Doctrine\\ORM\\Mapping\\ClassMetadataInfo\.$#' + identifier: class.notFound count: 1 path: src/Sluggable/Mapping/Event/Adapter/ORM.php - - message: "#^Class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadataInfo not found\\.$#" + message: '#^Class Doctrine\\ORM\\Mapping\\ClassMetadataInfo not found\.$#' + identifier: class.notFound count: 1 path: src/Sluggable/Mapping/Event/Adapter/ORM.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:getFieldMapping\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getFieldMapping\(\)\.$#' + identifier: method.notFound count: 2 path: src/Sluggable/SluggableListener.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:getReflectionProperty\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getReflectionProperty\(\)\.$#' + identifier: method.notFound count: 7 path: src/Sluggable/SluggableListener.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getUnitOfWork\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\ObjectManager\:\:getUnitOfWork\(\)\.$#' + identifier: method.notFound count: 2 path: src/Sluggable/SluggableListener.php - - message: "#^Access to an undefined property Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:\\$isMappedSuperclass\\.$#" + message: '#^Access to an undefined property Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:\$isMappedSuperclass\.$#' + identifier: property.notFound count: 1 path: src/SoftDeleteable/Mapping/Validator.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:getFieldMapping\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getFieldMapping\(\)\.$#' + identifier: method.notFound count: 1 path: src/SoftDeleteable/Mapping/Validator.php - - message: "#^Access to an undefined property Gedmo\\\\SoftDeleteable\\\\Query\\\\TreeWalker\\\\Exec\\\\MultiTableDeleteExecutor\\:\\:\\$_sqlStatements\\.$#" + message: '#^Access to an undefined property Gedmo\\SoftDeleteable\\Query\\TreeWalker\\Exec\\MultiTableDeleteExecutor\:\:\$_sqlStatements\.$#' + identifier: property.notFound + count: 1 + path: src/SoftDeleteable/Query/TreeWalker/Exec/MultiTableDeleteExecutor.php + + - + message: '#^Call to function property_exists\(\) with \$this\(Gedmo\\SoftDeleteable\\Query\\TreeWalker\\Exec\\MultiTableDeleteExecutor\) and ''sqlStatements'' will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType count: 1 path: src/SoftDeleteable/Query/TreeWalker/Exec/MultiTableDeleteExecutor.php - - message: "#^Method Gedmo\\\\SoftDeleteable\\\\Query\\\\TreeWalker\\\\SoftDeleteableWalker\\:\\:__construct\\(\\) has parameter \\$parserResult with no type specified\\.$#" + message: '#^Method Gedmo\\SoftDeleteable\\Query\\TreeWalker\\SoftDeleteableWalker\:\:__construct\(\) has parameter \$parserResult with no type specified\.$#' + identifier: missingType.parameter count: 1 path: src/SoftDeleteable/Query/TreeWalker/SoftDeleteableWalker.php - - message: "#^Method Gedmo\\\\SoftDeleteable\\\\Query\\\\TreeWalker\\\\SoftDeleteableWalker\\:\\:__construct\\(\\) has parameter \\$query with no type specified\\.$#" + message: '#^Method Gedmo\\SoftDeleteable\\Query\\TreeWalker\\SoftDeleteableWalker\:\:__construct\(\) has parameter \$query with no type specified\.$#' + identifier: missingType.parameter count: 1 path: src/SoftDeleteable/Query/TreeWalker/SoftDeleteableWalker.php - - message: "#^Access to offset 'inherited' on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\AssociationFieldMapping\\.$#" + message: '#^Method Gedmo\\Sortable\\Entity\\Repository\\SortableRepository\:\:getBySortableGroupsQuery\(\) return type with generic class Doctrine\\ORM\\Query does not specify its types\: TKey, TResult$#' + identifier: missingType.generics + count: 1 + path: src/Sortable/Entity/Repository/SortableRepository.php + + - + message: '#^Access to offset ''inherited'' on an unknown class Doctrine\\ODM\\MongoDB\\Mapping\\AssociationFieldMapping\.$#' + identifier: class.notFound count: 1 path: src/Sortable/Mapping/Driver/Attribute.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:getFieldMapping\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getFieldMapping\(\)\.$#' + identifier: method.notFound count: 1 path: src/Sortable/Mapping/Driver/Xml.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:getFieldMapping\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getFieldMapping\(\)\.$#' + identifier: method.notFound count: 1 path: src/Sortable/Mapping/Driver/Yaml.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:getReflectionProperty\\(\\)\\.$#" - count: 5 + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getReflectionProperty\(\)\.$#' + identifier: method.notFound + count: 9 path: src/Sortable/SortableListener.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:getReflectionProperty\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\ObjectManager\:\:getUnitOfWork\(\)\.$#' + identifier: method.notFound count: 4 path: src/Sortable/SortableListener.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getUnitOfWork\\(\\)\\.$#" - count: 4 - path: src/Sortable/SortableListener.php - - - - message: "#^Call to an undefined method Gedmo\\\\Sortable\\\\Mapping\\\\Event\\\\SortableAdapter\\:\\:getMaxPosition\\(\\)\\.$#" + message: '#^Call to an undefined method Gedmo\\Sortable\\Mapping\\Event\\SortableAdapter\:\:getMaxPosition\(\)\.$#' + identifier: method.notFound count: 1 path: src/Sortable/SortableListener.php - - message: "#^Call to an undefined method Gedmo\\\\Sortable\\\\Mapping\\\\Event\\\\SortableAdapter\\:\\:updatePositions\\(\\)\\.$#" + message: '#^Call to an undefined method Gedmo\\Sortable\\Mapping\\Event\\SortableAdapter\:\:updatePositions\(\)\.$#' + identifier: method.notFound count: 1 path: src/Sortable/SortableListener.php - - message: "#^Access to offset 'inherited' on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\AssociationFieldMapping\\.$#" + message: '#^Access to offset ''inherited'' on an unknown class Doctrine\\ODM\\MongoDB\\Mapping\\AssociationFieldMapping\.$#' + identifier: class.notFound count: 1 path: src/Timestampable/Mapping/Driver/Attribute.php - - message: "#^Property Gedmo\\\\Mapping\\\\Annotation\\\\Timestampable\\:\\:\\$field \\(array\\\\|string\\) in isset\\(\\) is not nullable\\.$#" + message: '#^Property Gedmo\\Mapping\\Annotation\\Timestampable\:\:\$field \(array\\|string\) in isset\(\) is not nullable\.$#' + identifier: isset.property count: 1 path: src/Timestampable/Mapping/Driver/Attribute.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:getFieldMapping\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getFieldMapping\(\)\.$#' + identifier: method.notFound count: 1 path: src/Timestampable/Mapping/Driver/Xml.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:getFieldMapping\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getFieldMapping\(\)\.$#' + identifier: method.notFound count: 1 path: src/Timestampable/Mapping/Driver/Yaml.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getUnitOfWork\\(\\)\\.$#" + message: '#^Access to an undefined property ProxyManager\\Proxy\\GhostObjectInterface&TObject of object\:\:\$identifier\.$#' + identifier: property.notFound count: 1 - path: src/Tool/Wrapper/EntityWrapper.php - - - - message: "#^Parameter \\#2 \\$em of class Gedmo\\\\Tool\\\\Wrapper\\\\EntityWrapper constructor expects Doctrine\\\\ORM\\\\EntityManagerInterface, Doctrine\\\\Persistence\\\\ObjectManager given\\.$#" - count: 1 - path: src/Tool/Wrapper/EntityWrapper.php - - - - message: "#^Access to an undefined property ProxyManager\\\\Proxy\\\\GhostObjectInterface\\:\\:\\$identifier\\.$#" - count: 1 - path: src/Tool/Wrapper/MongoDocumentWrapper.php - - - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getUnitOfWork\\(\\)\\.$#" - count: 2 path: src/Tool/Wrapper/MongoDocumentWrapper.php - - message: "#^Call to function property_exists\\(\\) with \\$this\\(Gedmo\\\\Translatable\\\\Hydrator\\\\ORM\\\\ObjectHydrator\\) and '_em' will always evaluate to false\\.$#" + message: '#^Call to function property_exists\(\) with \$this\(Gedmo\\Translatable\\Hydrator\\ORM\\ObjectHydrator\) and ''_em'' will always evaluate to false\.$#' + identifier: function.impossibleType count: 1 path: src/Translatable/Hydrator/ORM/ObjectHydrator.php - - message: "#^Method Gedmo\\\\Translatable\\\\Hydrator\\\\ORM\\\\ObjectHydrator\\:\\:hydrateAllData\\(\\) return type has no value type specified in iterable type array\\.$#" + message: '#^Method Gedmo\\Translatable\\Hydrator\\ORM\\ObjectHydrator\:\:hydrateAllData\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: src/Translatable/Hydrator/ORM/ObjectHydrator.php - - message: "#^Call to function property_exists\\(\\) with \\$this\\(Gedmo\\\\Translatable\\\\Hydrator\\\\ORM\\\\SimpleObjectHydrator\\) and '_em' will always evaluate to false\\.$#" + message: '#^Call to function property_exists\(\) with \$this\(Gedmo\\Translatable\\Hydrator\\ORM\\SimpleObjectHydrator\) and ''_em'' will always evaluate to false\.$#' + identifier: function.impossibleType count: 1 path: src/Translatable/Hydrator/ORM/SimpleObjectHydrator.php - - message: "#^Method Gedmo\\\\Translatable\\\\Hydrator\\\\ORM\\\\SimpleObjectHydrator\\:\\:hydrateAllData\\(\\) return type has no value type specified in iterable type array\\.$#" + message: '#^Method Gedmo\\Translatable\\Hydrator\\ORM\\SimpleObjectHydrator\:\:hydrateAllData\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: src/Translatable/Hydrator/ORM/SimpleObjectHydrator.php - - message: "#^Access to offset 'inherited' on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\AssociationFieldMapping\\.$#" + message: '#^Access to offset ''inherited'' on an unknown class Doctrine\\ODM\\MongoDB\\Mapping\\AssociationFieldMapping\.$#' + identifier: class.notFound count: 1 path: src/Translatable/Mapping/Driver/Attribute.php - - message: "#^Access to offset 'association' on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\FieldMapping\\.$#" + message: '#^Access to offset ''association'' on an unknown class Doctrine\\ODM\\MongoDB\\Mapping\\FieldMapping\.$#' + identifier: class.notFound count: 2 path: src/Translatable/Mapping/Event/Adapter/ODM.php - - message: "#^Access to offset 'fieldName' on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\FieldMapping\\.$#" + message: '#^Access to offset ''fieldName'' on an unknown class Doctrine\\ODM\\MongoDB\\Mapping\\FieldMapping\.$#' + identifier: class.notFound count: 1 path: src/Translatable/Mapping/Event/Adapter/ODM.php - - message: "#^Access to offset 'mappedBy' on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\FieldMapping\\.$#" + message: '#^Access to offset ''mappedBy'' on an unknown class Doctrine\\ODM\\MongoDB\\Mapping\\FieldMapping\.$#' + identifier: class.notFound count: 1 path: src/Translatable/Mapping/Event/Adapter/ODM.php - - message: "#^Access to offset 'targetDocument' on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\FieldMapping\\.$#" + message: '#^Access to offset ''targetDocument'' on an unknown class Doctrine\\ODM\\MongoDB\\Mapping\\FieldMapping\.$#' + identifier: class.notFound count: 1 path: src/Translatable/Mapping/Event/Adapter/ODM.php - - message: "#^Call to method getAssociationMappings\\(\\) on an unknown class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadataInfo\\.$#" + message: '#^Call to method getAssociationMappings\(\) on an unknown class Doctrine\\ORM\\Mapping\\ClassMetadataInfo\.$#' + identifier: class.notFound count: 1 path: src/Translatable/Mapping/Event/Adapter/ORM.php - - message: "#^Class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadataInfo not found\\.$#" + message: '#^Class Doctrine\\ORM\\Mapping\\ClassMetadataInfo not found\.$#' + identifier: class.notFound count: 1 path: src/Translatable/Mapping/Event/Adapter/ORM.php - - message: "#^Access to an undefined property Doctrine\\\\ORM\\\\Query\\\\AST\\\\Join\\:\\:\\$aliasIdentificationVariable\\.$#" + message: '#^Access to an undefined property Doctrine\\ORM\\Query\\AST\\Join\:\:\$aliasIdentificationVariable\.$#' + identifier: property.notFound count: 1 path: src/Translatable/Query/TreeWalker/TranslationWalker.php - - message: "#^Access to an undefined property Doctrine\\\\ORM\\\\Query\\\\AST\\\\Node\\:\\:\\$aliasIdentificationVariable\\.$#" + message: '#^Access to an undefined property Doctrine\\ORM\\Query\\AST\\Node\:\:\$aliasIdentificationVariable\.$#' + identifier: property.notFound count: 1 path: src/Translatable/Query/TreeWalker/TranslationWalker.php - - message: "#^Method Gedmo\\\\Translatable\\\\Query\\\\TreeWalker\\\\TranslationWalker\\:\\:__construct\\(\\) has parameter \\$parserResult with no type specified\\.$#" + message: '#^Method Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker\:\:__construct\(\) has parameter \$parserResult with no type specified\.$#' + identifier: missingType.parameter count: 1 path: src/Translatable/Query/TreeWalker/TranslationWalker.php - - message: "#^Method Gedmo\\\\Translatable\\\\Query\\\\TreeWalker\\\\TranslationWalker\\:\\:__construct\\(\\) has parameter \\$query with no type specified\\.$#" + message: '#^Method Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker\:\:__construct\(\) has parameter \$query with no type specified\.$#' + identifier: missingType.parameter count: 1 path: src/Translatable/Query/TreeWalker/TranslationWalker.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:getReflectionProperty\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getReflectionProperty\(\)\.$#' + identifier: method.notFound count: 1 path: src/Translatable/TranslatableListener.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:newInstance\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:newInstance\(\)\.$#' + identifier: method.notFound count: 1 path: src/Translatable/TranslatableListener.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getUnitOfWork\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\ObjectManager\:\:getUnitOfWork\(\)\.$#' + identifier: method.notFound count: 4 path: src/Translatable/TranslatableListener.php - - message: "#^Call to an undefined method Gedmo\\\\Tree\\\\Strategy\\:\\:updateNode\\(\\)\\.$#" + message: '#^Method Gedmo\\Tree\\Entity\\Repository\\AbstractTreeRepository\:\:getChildrenQuery\(\) return type with generic class Doctrine\\ORM\\Query does not specify its types\: TKey, TResult$#' + identifier: missingType.generics + count: 1 + path: src/Tree/Entity/Repository/AbstractTreeRepository.php + + - + message: '#^Method Gedmo\\Tree\\Entity\\Repository\\AbstractTreeRepository\:\:getNodesHierarchyQuery\(\) return type with generic class Doctrine\\ORM\\Query does not specify its types\: TKey, TResult$#' + identifier: missingType.generics + count: 1 + path: src/Tree/Entity/Repository/AbstractTreeRepository.php + + - + message: '#^Method Gedmo\\Tree\\Entity\\Repository\\AbstractTreeRepository\:\:getRootNodesQuery\(\) return type with generic class Doctrine\\ORM\\Query does not specify its types\: TKey, TResult$#' + identifier: missingType.generics + count: 1 + path: src/Tree/Entity/Repository/AbstractTreeRepository.php + + - + message: '#^Call to an undefined method Gedmo\\Tree\\Strategy\:\:updateNode\(\)\.$#' + identifier: method.notFound + count: 1 + path: src/Tree/Entity/Repository/ClosureTreeRepository.php + + - + message: '#^Method Gedmo\\Tree\\Entity\\Repository\\ClosureTreeRepository\:\:childrenQuery\(\) return type with generic class Doctrine\\ORM\\Query does not specify its types\: TKey, TResult$#' + identifier: missingType.generics + count: 1 + path: src/Tree/Entity/Repository/ClosureTreeRepository.php + + - + message: '#^Method Gedmo\\Tree\\Entity\\Repository\\ClosureTreeRepository\:\:getChildrenQuery\(\) return type with generic class Doctrine\\ORM\\Query does not specify its types\: TKey, TResult$#' + identifier: missingType.generics count: 1 path: src/Tree/Entity/Repository/ClosureTreeRepository.php - - message: "#^Parameter \\#1 \\$association of method Gedmo\\\\Tree\\\\Entity\\\\Repository\\\\ClosureTreeRepository\\\\:\\:getJoinColumnFieldName\\(\\) expects array\\, Doctrine\\\\ORM\\\\Mapping\\\\AssociationMapping given\\.$#" + message: '#^Method Gedmo\\Tree\\Entity\\Repository\\ClosureTreeRepository\:\:getNodesHierarchyQuery\(\) return type with generic class Doctrine\\ORM\\Query does not specify its types\: TKey, TResult$#' + identifier: missingType.generics + count: 1 + path: src/Tree/Entity/Repository/ClosureTreeRepository.php + + - + message: '#^Method Gedmo\\Tree\\Entity\\Repository\\ClosureTreeRepository\:\:getPathQuery\(\) return type with generic class Doctrine\\ORM\\Query does not specify its types\: TKey, TResult$#' + identifier: missingType.generics + count: 1 + path: src/Tree/Entity/Repository/ClosureTreeRepository.php + + - + message: '#^Method Gedmo\\Tree\\Entity\\Repository\\ClosureTreeRepository\:\:getRootNodesQuery\(\) return type with generic class Doctrine\\ORM\\Query does not specify its types\: TKey, TResult$#' + identifier: missingType.generics + count: 1 + path: src/Tree/Entity/Repository/ClosureTreeRepository.php + + - + message: '#^Parameter \#1 \$association of method Gedmo\\Tree\\Entity\\Repository\\ClosureTreeRepository\\:\:getJoinColumnFieldName\(\) expects array\, Doctrine\\ORM\\Mapping\\AssociationMapping given\.$#' + identifier: argument.type count: 2 path: src/Tree/Entity/Repository/ClosureTreeRepository.php - - message: "#^Call to an undefined method Gedmo\\\\Tree\\\\Strategy\\:\\:max\\(\\)\\.$#" + message: '#^Strict comparison using \!\=\= between array\{\} and non\-empty\-array will always evaluate to true\.$#' + identifier: notIdentical.alwaysTrue + count: 1 + path: src/Tree/Entity/Repository/ClosureTreeRepository.php + + - + message: '#^Method Gedmo\\Tree\\Entity\\Repository\\MaterializedPathRepository\:\:getChildrenQuery\(\) return type with generic class Doctrine\\ORM\\Query does not specify its types\: TKey, TResult$#' + identifier: missingType.generics + count: 1 + path: src/Tree/Entity/Repository/MaterializedPathRepository.php + + - + message: '#^Method Gedmo\\Tree\\Entity\\Repository\\MaterializedPathRepository\:\:getNodesHierarchyQuery\(\) return type with generic class Doctrine\\ORM\\Query does not specify its types\: TKey, TResult$#' + identifier: missingType.generics + count: 1 + path: src/Tree/Entity/Repository/MaterializedPathRepository.php + + - + message: '#^Method Gedmo\\Tree\\Entity\\Repository\\MaterializedPathRepository\:\:getPathQuery\(\) return type with generic class Doctrine\\ORM\\Query does not specify its types\: TKey, TResult$#' + identifier: missingType.generics + count: 1 + path: src/Tree/Entity/Repository/MaterializedPathRepository.php + + - + message: '#^Method Gedmo\\Tree\\Entity\\Repository\\MaterializedPathRepository\:\:getRootNodesQuery\(\) return type with generic class Doctrine\\ORM\\Query does not specify its types\: TKey, TResult$#' + identifier: missingType.generics + count: 1 + path: src/Tree/Entity/Repository/MaterializedPathRepository.php + + - + message: '#^Method Gedmo\\Tree\\Entity\\Repository\\MaterializedPathRepository\:\:getTreeQuery\(\) return type with generic class Doctrine\\ORM\\Query does not specify its types\: TKey, TResult$#' + identifier: missingType.generics + count: 1 + path: src/Tree/Entity/Repository/MaterializedPathRepository.php + + - + message: '#^Call to an undefined method Gedmo\\Tree\\Strategy\:\:max\(\)\.$#' + identifier: method.notFound count: 1 path: src/Tree/Entity/Repository/NestedTreeRepository.php - - message: "#^Call to an undefined method Gedmo\\\\Tree\\\\Strategy\\:\\:setNodePosition\\(\\)\\.$#" + message: '#^Call to an undefined method Gedmo\\Tree\\Strategy\:\:setNodePosition\(\)\.$#' + identifier: method.notFound count: 1 path: src/Tree/Entity/Repository/NestedTreeRepository.php - - message: "#^Call to an undefined method Gedmo\\\\Tree\\\\Strategy\\:\\:shiftRL\\(\\)\\.$#" + message: '#^Call to an undefined method Gedmo\\Tree\\Strategy\:\:shiftRL\(\)\.$#' + identifier: method.notFound count: 3 path: src/Tree/Entity/Repository/NestedTreeRepository.php - - message: "#^Call to an undefined method Gedmo\\\\Tree\\\\Strategy\\:\\:shiftRangeRL\\(\\)\\.$#" + message: '#^Call to an undefined method Gedmo\\Tree\\Strategy\:\:shiftRangeRL\(\)\.$#' + identifier: method.notFound count: 2 path: src/Tree/Entity/Repository/NestedTreeRepository.php - - message: "#^Call to an undefined method Gedmo\\\\Tree\\\\Strategy\\:\\:updateNode\\(\\)\\.$#" + message: '#^Call to an undefined method Gedmo\\Tree\\Strategy\:\:updateNode\(\)\.$#' + identifier: method.notFound count: 2 path: src/Tree/Entity/Repository/NestedTreeRepository.php - - message: "#^Call to function property_exists\\(\\) with \\$this\\(Gedmo\\\\Tree\\\\Hydrator\\\\ORM\\\\TreeObjectHydrator\\) and '_em' will always evaluate to false\\.$#" + message: '#^Method Gedmo\\Tree\\Entity\\Repository\\NestedTreeRepository\:\:childrenQuery\(\) return type with generic class Doctrine\\ORM\\Query does not specify its types\: TKey, TResult$#' + identifier: missingType.generics + count: 1 + path: src/Tree/Entity/Repository/NestedTreeRepository.php + + - + message: '#^Method Gedmo\\Tree\\Entity\\Repository\\NestedTreeRepository\:\:getChildrenQuery\(\) return type with generic class Doctrine\\ORM\\Query does not specify its types\: TKey, TResult$#' + identifier: missingType.generics + count: 1 + path: src/Tree/Entity/Repository/NestedTreeRepository.php + + - + message: '#^Method Gedmo\\Tree\\Entity\\Repository\\NestedTreeRepository\:\:getLeafsQuery\(\) return type with generic class Doctrine\\ORM\\Query does not specify its types\: TKey, TResult$#' + identifier: missingType.generics + count: 1 + path: src/Tree/Entity/Repository/NestedTreeRepository.php + + - + message: '#^Method Gedmo\\Tree\\Entity\\Repository\\NestedTreeRepository\:\:getNextSiblingsQuery\(\) return type with generic class Doctrine\\ORM\\Query does not specify its types\: TKey, TResult$#' + identifier: missingType.generics + count: 1 + path: src/Tree/Entity/Repository/NestedTreeRepository.php + + - + message: '#^Method Gedmo\\Tree\\Entity\\Repository\\NestedTreeRepository\:\:getNodesHierarchyQuery\(\) return type with generic class Doctrine\\ORM\\Query does not specify its types\: TKey, TResult$#' + identifier: missingType.generics + count: 1 + path: src/Tree/Entity/Repository/NestedTreeRepository.php + + - + message: '#^Method Gedmo\\Tree\\Entity\\Repository\\NestedTreeRepository\:\:getPrevSiblingsQuery\(\) return type with generic class Doctrine\\ORM\\Query does not specify its types\: TKey, TResult$#' + identifier: missingType.generics + count: 1 + path: src/Tree/Entity/Repository/NestedTreeRepository.php + + - + message: '#^Method Gedmo\\Tree\\Entity\\Repository\\NestedTreeRepository\:\:getRootNodesQuery\(\) return type with generic class Doctrine\\ORM\\Query does not specify its types\: TKey, TResult$#' + identifier: missingType.generics + count: 1 + path: src/Tree/Entity/Repository/NestedTreeRepository.php + + - + message: '#^Call to function property_exists\(\) with \$this\(Gedmo\\Tree\\Hydrator\\ORM\\TreeObjectHydrator\) and ''_em'' will always evaluate to false\.$#' + identifier: function.impossibleType count: 1 path: src/Tree/Hydrator/ORM/TreeObjectHydrator.php - - message: "#^Method Gedmo\\\\Tree\\\\Hydrator\\\\ORM\\\\TreeObjectHydrator\\:\\:hydrateAllData\\(\\) return type has no value type specified in iterable type array\\.$#" + message: '#^Method Gedmo\\Tree\\Hydrator\\ORM\\TreeObjectHydrator\:\:hydrateAllData\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: src/Tree/Hydrator/ORM/TreeObjectHydrator.php - - message: "#^Access to offset 'inherited' on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\AssociationFieldMapping\\.$#" + message: '#^Access to offset ''inherited'' on an unknown class Doctrine\\ODM\\MongoDB\\Mapping\\AssociationFieldMapping\.$#' + identifier: class.notFound count: 1 path: src/Tree/Mapping/Driver/Attribute.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:getFieldMapping\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getFieldMapping\(\)\.$#' + identifier: method.notFound count: 6 path: src/Tree/Mapping/Validator.php - - message: "#^Method Gedmo\\\\Tree\\\\RepositoryUtils\\:\\:buildTreeArray\\(\\) should return array\\\\> but returns array\\, ArrayAccess\\>\\.$#" + message: '#^Method Gedmo\\Tree\\RepositoryUtils\:\:buildTreeArray\(\) should return array\\> but returns array\, ArrayAccess\>\.$#' + identifier: return.type count: 1 path: src/Tree/RepositoryUtils.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:getFieldMapping\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getFieldMapping\(\)\.$#' + identifier: method.notFound count: 1 path: src/Tree/Strategy/AbstractMaterializedPath.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:getIdentifierValue\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getIdentifierValue\(\)\.$#' + identifier: method.notFound count: 1 path: src/Tree/Strategy/AbstractMaterializedPath.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:getReflectionProperty\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getReflectionProperty\(\)\.$#' + identifier: method.notFound count: 10 path: src/Tree/Strategy/AbstractMaterializedPath.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:getSingleIdentifierFieldName\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getSingleIdentifierFieldName\(\)\.$#' + identifier: method.notFound count: 1 path: src/Tree/Strategy/AbstractMaterializedPath.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getReference\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\ObjectManager\:\:getReference\(\)\.$#' + identifier: method.notFound count: 1 path: src/Tree/Strategy/AbstractMaterializedPath.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getUnitOfWork\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\ObjectManager\:\:getUnitOfWork\(\)\.$#' + identifier: method.notFound count: 2 path: src/Tree/Strategy/AbstractMaterializedPath.php - - message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\\\:\\:children\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\ORM\\EntityRepository\\:\:children\(\)\.$#' + identifier: method.notFound count: 1 path: src/Tree/Strategy/ORM/Closure.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getUnitOfWork\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\ObjectManager\:\:getUnitOfWork\(\)\.$#' + identifier: method.notFound count: 1 path: src/Tree/TreeListener.php - - message: "#^Method Gedmo\\\\Uploadable\\\\Event\\\\UploadableBaseEventArgs\\:\\:__construct\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + message: '#^Method Gedmo\\Uploadable\\Event\\UploadableBaseEventArgs\:\:__construct\(\) has parameter \$config with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: src/Uploadable/Event/UploadableBaseEventArgs.php - - message: "#^Method Gedmo\\\\Uploadable\\\\Event\\\\UploadableBaseEventArgs\\:\\:getExtensionConfiguration\\(\\) return type has no value type specified in iterable type array\\.$#" + message: '#^Method Gedmo\\Uploadable\\Event\\UploadableBaseEventArgs\:\:getExtensionConfiguration\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: src/Uploadable/Event/UploadableBaseEventArgs.php - - message: "#^Property Gedmo\\\\Uploadable\\\\Event\\\\UploadableBaseEventArgs\\:\\:\\$config is never read, only written\\.$#" + message: '#^Property Gedmo\\Uploadable\\Event\\UploadableBaseEventArgs\:\:\$config is never read, only written\.$#' + identifier: property.onlyWritten count: 1 path: src/Uploadable/Event/UploadableBaseEventArgs.php - - message: "#^Property Gedmo\\\\Uploadable\\\\Event\\\\UploadableBaseEventArgs\\:\\:\\$config type has no value type specified in iterable type array\\.$#" + message: '#^Property Gedmo\\Uploadable\\Event\\UploadableBaseEventArgs\:\:\$config type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: src/Uploadable/Event/UploadableBaseEventArgs.php - - message: "#^Property Gedmo\\\\Uploadable\\\\Event\\\\UploadableBaseEventArgs\\:\\:\\$extensionConfiguration is never written, only read\\.$#" + message: '#^Property Gedmo\\Uploadable\\Event\\UploadableBaseEventArgs\:\:\$extensionConfiguration is never written, only read\.$#' + identifier: property.onlyRead count: 1 path: src/Uploadable/Event/UploadableBaseEventArgs.php - - message: "#^Property Gedmo\\\\Uploadable\\\\Event\\\\UploadableBaseEventArgs\\:\\:\\$extensionConfiguration type has no value type specified in iterable type array\\.$#" + message: '#^Property Gedmo\\Uploadable\\Event\\UploadableBaseEventArgs\:\:\$extensionConfiguration type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: src/Uploadable/Event/UploadableBaseEventArgs.php - - message: "#^Access to an undefined property Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:\\$isMappedSuperclass\\.$#" + message: '#^Method Gedmo\\Uploadable\\FileInfo\\FileInfoArray\:\:getName\(\) never returns null so it can be removed from the return type\.$#' + identifier: return.unusedType + count: 1 + path: src/Uploadable/FileInfo/FileInfoArray.php + + - + message: '#^Method Gedmo\\Uploadable\\FileInfo\\FileInfoArray\:\:getSize\(\) never returns null so it can be removed from the return type\.$#' + identifier: return.unusedType + count: 1 + path: src/Uploadable/FileInfo/FileInfoArray.php + + - + message: '#^Method Gedmo\\Uploadable\\FileInfo\\FileInfoArray\:\:getTmpName\(\) never returns null so it can be removed from the return type\.$#' + identifier: return.unusedType + count: 1 + path: src/Uploadable/FileInfo/FileInfoArray.php + + - + message: '#^Method Gedmo\\Uploadable\\FileInfo\\FileInfoArray\:\:getType\(\) never returns null so it can be removed from the return type\.$#' + identifier: return.unusedType + count: 1 + path: src/Uploadable/FileInfo/FileInfoArray.php + + - + message: '#^Access to an undefined property Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:\$isMappedSuperclass\.$#' + identifier: property.notFound count: 1 path: src/Uploadable/Mapping/Validator.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:getFieldMapping\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getFieldMapping\(\)\.$#' + identifier: method.notFound count: 1 path: src/Uploadable/Mapping/Validator.php - - message: "#^Negated boolean expression is always false\\.$#" + message: '#^Negated boolean expression is always false\.$#' + identifier: booleanNot.alwaysFalse count: 1 path: src/Uploadable/MimeType/MimeTypeGuesser.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:getReflectionProperty\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getReflectionProperty\(\)\.$#' + identifier: method.notFound count: 1 path: src/Uploadable/UploadableListener.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getUnitOfWork\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\ObjectManager\:\:getUnitOfWork\(\)\.$#' + identifier: method.notFound count: 3 path: src/Uploadable/UploadableListener.php - - message: "#^Class Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AnnotationDriver not found\\.$#" + message: '#^Class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#' + identifier: class.notFound count: 2 path: tests/Gedmo/DoctrineExtensionsTest.php - - message: "#^Class Gedmo\\\\Tests\\\\Translatable\\\\Fixture\\\\CategoryTranslation not found\\.$#" + message: '#^Property Gedmo\\Tests\\Mapping\\Fixture\\Attribute\\TranslatableModel\:\:\$title \(string\|null\) is never assigned string so it can be removed from the property type\.$#' + identifier: property.unusedType + count: 1 + path: tests/Gedmo/Mapping/Fixture/Attribute/TranslatableModel.php + + - + message: '#^Property Gedmo\\Tests\\Mapping\\Fixture\\Attribute\\TranslatableModel\:\:\$titleFallbackFalse \(string\|null\) is never assigned string so it can be removed from the property type\.$#' + identifier: property.unusedType + count: 1 + path: tests/Gedmo/Mapping/Fixture/Attribute/TranslatableModel.php + + - + message: '#^Property Gedmo\\Tests\\Mapping\\Fixture\\Attribute\\TranslatableModel\:\:\$titleFallbackTrue \(string\|null\) is never assigned string so it can be removed from the property type\.$#' + identifier: property.unusedType + count: 1 + path: tests/Gedmo/Mapping/Fixture/Attribute/TranslatableModel.php + + - + message: '#^Class Gedmo\\Tests\\Translatable\\Fixture\\CategoryTranslation not found\.$#' + identifier: class.notFound count: 1 path: tests/Gedmo/Mapping/Fixture/Category.php - - message: "#^Instantiated class Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AnnotationDriver not found\\.$#" + message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#' + identifier: class.notFound count: 2 path: tests/Gedmo/Mapping/MappingEventSubscriberTest.php - - message: "#^Parameter \\#1 \\$driverImpl of method Doctrine\\\\ORM\\\\Configuration\\:\\:setMetadataDriverImpl\\(\\) expects Doctrine\\\\Persistence\\\\Mapping\\\\Driver\\\\MappingDriver, Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AnnotationDriver given\\.$#" + message: '#^Parameter \#1 \$driverImpl of method Doctrine\\ORM\\Configuration\:\:setMetadataDriverImpl\(\) expects Doctrine\\Persistence\\Mapping\\Driver\\MappingDriver, Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver given\.$#' + identifier: argument.type count: 2 path: tests/Gedmo/Mapping/MappingEventSubscriberTest.php - - message: "#^Instantiated class Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AnnotationDriver not found\\.$#" + message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#' + identifier: class.notFound count: 1 path: tests/Gedmo/Mapping/MappingTest.php - - message: "#^Parameter \\#1 \\$driverImpl of method Doctrine\\\\ORM\\\\Configuration\\:\\:setMetadataDriverImpl\\(\\) expects Doctrine\\\\Persistence\\\\Mapping\\\\Driver\\\\MappingDriver, Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AnnotationDriver given\\.$#" + message: '#^Parameter \#1 \$driverImpl of method Doctrine\\ORM\\Configuration\:\:setMetadataDriverImpl\(\) expects Doctrine\\Persistence\\Mapping\\Driver\\MappingDriver, Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver given\.$#' + identifier: argument.type count: 1 path: tests/Gedmo/Mapping/MappingTest.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:mapField\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:mapField\(\)\.$#' + identifier: method.notFound count: 2 path: tests/Gedmo/Mapping/MetadataFactory/CustomDriverTest.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:setIdGeneratorType\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:setIdGeneratorType\(\)\.$#' + identifier: method.notFound count: 1 path: tests/Gedmo/Mapping/MetadataFactory/CustomDriverTest.php - - message: "#^Class Doctrine\\\\ORM\\\\Id\\\\IdentityGenerator does not have a constructor and must be instantiated without any parameters\\.$#" + message: '#^Class Doctrine\\ORM\\Id\\IdentityGenerator does not have a constructor and must be instantiated without any parameters\.$#' + identifier: new.noConstructor count: 1 path: tests/Gedmo/Mapping/MetadataFactory/ForcedMetadataTest.php - - message: "#^Instantiated class Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AnnotationDriver not found\\.$#" + message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#' + identifier: class.notFound count: 1 path: tests/Gedmo/Mapping/MetadataFactory/ForcedMetadataTest.php - - message: "#^Parameter \\#1 \\$driverImpl of method Doctrine\\\\ORM\\\\Configuration\\:\\:setMetadataDriverImpl\\(\\) expects Doctrine\\\\Persistence\\\\Mapping\\\\Driver\\\\MappingDriver, Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AnnotationDriver given\\.$#" + message: '#^Parameter \#1 \$driverImpl of method Doctrine\\ORM\\Configuration\:\:setMetadataDriverImpl\(\) expects Doctrine\\Persistence\\Mapping\\Driver\\MappingDriver, Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver given\.$#' + identifier: argument.type count: 1 path: tests/Gedmo/Mapping/MetadataFactory/ForcedMetadataTest.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\\\:\\:getReflectionProperty\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\Mapping\\ClassMetadata\\:\:getReflectionProperty\(\)\.$#' + identifier: method.notFound count: 2 path: tests/Gedmo/Mapping/Mock/Extension/Encoder/EncoderListener.php - - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getUnitOfWork\\(\\)\\.$#" + message: '#^Call to an undefined method Doctrine\\Persistence\\ObjectManager\:\:getUnitOfWork\(\)\.$#' + identifier: method.notFound count: 2 path: tests/Gedmo/Mapping/Mock/Extension/Encoder/EncoderListener.php - - message: "#^Access to offset 'inherited' on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\AssociationFieldMapping\\.$#" + message: '#^Access to offset ''inherited'' on an unknown class Doctrine\\ODM\\MongoDB\\Mapping\\AssociationFieldMapping\.$#' + identifier: class.notFound count: 1 path: tests/Gedmo/Mapping/Mock/Extension/Encoder/Mapping/Driver/Attribute.php - - message: "#^Instantiated class Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AnnotationDriver not found\\.$#" + message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#' + identifier: class.notFound count: 2 path: tests/Gedmo/Mapping/MultiManagerMappingTest.php - - message: "#^Parameter \\#1 \\$nestedDriver of method Doctrine\\\\Persistence\\\\Mapping\\\\Driver\\\\MappingDriverChain\\:\\:addDriver\\(\\) expects Doctrine\\\\Persistence\\\\Mapping\\\\Driver\\\\MappingDriver, Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AnnotationDriver given\\.$#" + message: '#^Parameter \#1 \$nestedDriver of method Doctrine\\Persistence\\Mapping\\Driver\\MappingDriverChain\:\:addDriver\(\) expects Doctrine\\Persistence\\Mapping\\Driver\\MappingDriver, Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver given\.$#' + identifier: argument.type count: 1 path: tests/Gedmo/Mapping/ORMMappingTestCase.php - - message: "#^Parameter \\#1 \\$nestedDriver of method Doctrine\\\\Persistence\\\\Mapping\\\\Driver\\\\MappingDriverChain\\:\\:addDriver\\(\\) expects Doctrine\\\\Persistence\\\\Mapping\\\\Driver\\\\MappingDriver, Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\YamlDriver given\\.$#" + message: '#^Parameter \#1 \$nestedDriver of method Doctrine\\Persistence\\Mapping\\Driver\\MappingDriverChain\:\:addDriver\(\) expects Doctrine\\Persistence\\Mapping\\Driver\\MappingDriver, Doctrine\\ORM\\Mapping\\Driver\\YamlDriver given\.$#' + identifier: argument.type count: 1 path: tests/Gedmo/Mapping/ORMMappingTestCase.php - - message: "#^Property Gedmo\\\\Tests\\\\Mapping\\\\ReferenceIntegrityMappingTest\\:\\:\\$dm is never written, only read\\.$#" + message: '#^Property Gedmo\\Tests\\Mapping\\ReferenceIntegrityMappingTest\:\:\$dm is never written, only read\.$#' + identifier: property.onlyRead count: 1 path: tests/Gedmo/Mapping/ReferenceIntegrityMappingTest.php - - message: "#^Property Gedmo\\\\Tests\\\\Mapping\\\\ReferenceIntegrityMappingTest\\:\\:\\$referenceIntegrity is never written, only read\\.$#" + message: '#^Property Gedmo\\Tests\\Mapping\\ReferenceIntegrityMappingTest\:\:\$referenceIntegrity is never written, only read\.$#' + identifier: property.onlyRead count: 1 path: tests/Gedmo/Mapping/ReferenceIntegrityMappingTest.php - - message: "#^Unreachable statement \\- code above always terminates\\.$#" + message: '#^Unreachable statement \- code above always terminates\.$#' + identifier: deadCode.unreachable count: 1 path: tests/Gedmo/Mapping/ReferenceIntegrityMappingTest.php - - message: "#^Instantiated class Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AnnotationDriver not found\\.$#" + message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#' + identifier: class.notFound count: 1 path: tests/Gedmo/Mapping/TreeMappingTest.php - - message: "#^Instantiated class Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\YamlDriver not found\\.$#" + message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\YamlDriver not found\.$#' + identifier: class.notFound count: 1 path: tests/Gedmo/Mapping/TreeMappingTest.php - - message: "#^Parameter \\#1 \\$nestedDriver of method Doctrine\\\\Persistence\\\\Mapping\\\\Driver\\\\MappingDriverChain\\:\\:addDriver\\(\\) expects Doctrine\\\\Persistence\\\\Mapping\\\\Driver\\\\MappingDriver, Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\YamlDriver given\\.$#" + message: '#^Parameter \#1 \$nestedDriver of method Doctrine\\Persistence\\Mapping\\Driver\\MappingDriverChain\:\:addDriver\(\) expects Doctrine\\Persistence\\Mapping\\Driver\\MappingDriver, Doctrine\\ORM\\Mapping\\Driver\\YamlDriver given\.$#' + identifier: argument.type count: 1 path: tests/Gedmo/Mapping/TreeMappingTest.php - - message: "#^Instantiated class Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AnnotationDriver not found\\.$#" + message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#' + identifier: class.notFound count: 1 path: tests/Gedmo/Mapping/Xml/ClosureTreeMappingTest.php - - message: "#^Instantiated class Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AnnotationDriver not found\\.$#" + message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#' + identifier: class.notFound count: 1 path: tests/Gedmo/Mapping/Xml/MaterializedPathTreeMappingTest.php - - message: "#^Instantiated class Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AnnotationDriver not found\\.$#" + message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#' + identifier: class.notFound count: 1 path: tests/Gedmo/Mapping/Xml/ReferencesMappingTest.php - - message: "#^Instantiated class Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AnnotationDriver not found\\.$#" + message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#' + identifier: class.notFound count: 1 path: tests/Gedmo/Mapping/Xml/TranslatableMappingTest.php - - message: "#^Method Gedmo\\\\Tests\\\\Sluggable\\\\Fixture\\\\Doctrine\\\\FakeFilter\\:\\:addFilterConstraint\\(\\) has parameter \\$targetTableAlias with no type specified\\.$#" + message: '#^Method Gedmo\\Tests\\Sluggable\\Fixture\\Doctrine\\FakeFilter\:\:addFilterConstraint\(\) has parameter \$targetTableAlias with no type specified\.$#' + identifier: missingType.parameter count: 1 path: tests/Gedmo/Sluggable/Fixture/Doctrine/FakeFilter.php - - message: "#^Instantiated class Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\YamlDriver not found\\.$#" + message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\YamlDriver not found\.$#' + identifier: class.notFound count: 1 path: tests/Gedmo/Sluggable/Issue/Issue116Test.php - - message: "#^Parameter \\#1 \\$nestedDriver of method Doctrine\\\\Persistence\\\\Mapping\\\\Driver\\\\MappingDriverChain\\:\\:addDriver\\(\\) expects Doctrine\\\\Persistence\\\\Mapping\\\\Driver\\\\MappingDriver, Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\YamlDriver given\\.$#" + message: '#^Parameter \#1 \$nestedDriver of method Doctrine\\Persistence\\Mapping\\Driver\\MappingDriverChain\:\:addDriver\(\) expects Doctrine\\Persistence\\Mapping\\Driver\\MappingDriver, Doctrine\\ORM\\Mapping\\Driver\\YamlDriver given\.$#' + identifier: argument.type count: 1 path: tests/Gedmo/Sluggable/Issue/Issue116Test.php - - message: "#^Parameter \\$args of method Gedmo\\\\Tests\\\\SoftDeleteable\\\\Fixture\\\\Listener\\\\WithLifecycleEventArgsFromORMTypeListener\\:\\:postSoftDelete\\(\\) has invalid type Doctrine\\\\ORM\\\\Event\\\\LifecycleEventArgs\\.$#" + message: '#^Parameter \$args of method Gedmo\\Tests\\SoftDeleteable\\Fixture\\Listener\\WithLifecycleEventArgsFromORMTypeListener\:\:postSoftDelete\(\) has invalid type Doctrine\\ORM\\Event\\LifecycleEventArgs\.$#' + identifier: class.notFound count: 1 path: tests/Gedmo/SoftDeleteable/Fixture/Listener/WithLifecycleEventArgsFromORMTypeListener.php - - message: "#^Parameter \\$args of method Gedmo\\\\Tests\\\\SoftDeleteable\\\\Fixture\\\\Listener\\\\WithLifecycleEventArgsFromORMTypeListener\\:\\:preSoftDelete\\(\\) has invalid type Doctrine\\\\ORM\\\\Event\\\\LifecycleEventArgs\\.$#" + message: '#^Parameter \$args of method Gedmo\\Tests\\SoftDeleteable\\Fixture\\Listener\\WithLifecycleEventArgsFromORMTypeListener\:\:preSoftDelete\(\) has invalid type Doctrine\\ORM\\Event\\LifecycleEventArgs\.$#' + identifier: class.notFound count: 1 path: tests/Gedmo/SoftDeleteable/Fixture/Listener/WithLifecycleEventArgsFromORMTypeListener.php - - message: "#^Method Gedmo\\\\Tests\\\\Timestampable\\\\Fixture\\\\ArticleCarbon\\:\\:getCreated\\(\\) should return Carbon\\\\Carbon\\|null but returns DateTime\\|null\\.$#" + message: '#^Method Gedmo\\Tests\\Timestampable\\Fixture\\ArticleCarbon\:\:getCreated\(\) should return Carbon\\Carbon\|null but returns DateTime\|null\.$#' + identifier: return.type count: 1 path: tests/Gedmo/Timestampable/Fixture/ArticleCarbon.php - - message: "#^Call to function method_exists\\(\\) with Doctrine\\\\ORM\\\\EntityManager\\|null and 'merge' will always evaluate to false\\.$#" + message: '#^Call to function method_exists\(\) with Doctrine\\ORM\\EntityManager\|null and ''merge'' will always evaluate to false\.$#' + identifier: function.impossibleType count: 2 path: tests/Gedmo/Timestampable/TimestampableTest.php - - message: "#^Instantiated class Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AnnotationDriver not found\\.$#" + message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#' + identifier: class.notFound count: 1 path: tests/Gedmo/Tool/BaseTestCaseOM.php - - message: "#^Method Gedmo\\\\Tests\\\\Tool\\\\BaseTestCaseOM\\:\\:getORMDriver\\(\\) should return Doctrine\\\\Persistence\\\\Mapping\\\\Driver\\\\MappingDriver but returns Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AnnotationDriver\\.$#" + message: '#^Method Gedmo\\Tests\\Tool\\BaseTestCaseOM\:\:getORMDriver\(\) should return Doctrine\\Persistence\\Mapping\\Driver\\MappingDriver but returns Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\.$#' + identifier: return.type count: 1 path: tests/Gedmo/Tool/BaseTestCaseOM.php - - message: "#^Instantiated class Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AnnotationDriver not found\\.$#" + message: '#^Instantiated class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver not found\.$#' + identifier: class.notFound count: 1 path: tests/Gedmo/Tool/BaseTestCaseORM.php - - message: "#^Method Gedmo\\\\Tests\\\\Tool\\\\BaseTestCaseORM\\:\\:getMetadataDriverImplementation\\(\\) should return Doctrine\\\\Persistence\\\\Mapping\\\\Driver\\\\MappingDriver but returns Doctrine\\\\ORM\\\\Mapping\\\\Driver\\\\AnnotationDriver\\.$#" + message: '#^Method Gedmo\\Tests\\Tool\\BaseTestCaseORM\:\:getMetadataDriverImplementation\(\) should return Doctrine\\Persistence\\Mapping\\Driver\\MappingDriver but returns Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver\.$#' + identifier: return.type count: 1 path: tests/Gedmo/Tool/BaseTestCaseORM.php - - message: "#^Property Gedmo\\\\Tests\\\\Tree\\\\MaterializedPathODMMongoDBRepositoryTest\\:\\:\\$repo \\(Gedmo\\\\Tree\\\\Document\\\\MongoDB\\\\Repository\\\\MaterializedPathRepository\\\\) does not accept Doctrine\\\\ORM\\\\EntityRepository\\\\.$#" + message: '#^Property Gedmo\\Tests\\Tree\\MaterializedPathODMMongoDBRepositoryTest\:\:\$repo \(Gedmo\\Tree\\Document\\MongoDB\\Repository\\MaterializedPathRepository\\) does not accept Doctrine\\ORM\\EntityRepository\\.$#' + identifier: assign.propertyType count: 1 path: tests/Gedmo/Tree/MaterializedPathODMMongoDBRepositoryTest.php - - message: "#^Unreachable statement \\- code above always terminates\\.$#" + message: '#^Unreachable statement \- code above always terminates\.$#' + identifier: deadCode.unreachable count: 1 path: tests/Gedmo/Tree/MaterializedPathODMMongoDBTreeLockingTest.php - - - message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertIsArray\\(\\) with true will always evaluate to false\\.$#" - count: 1 - path: tests/Gedmo/Tree/NestedTreeRootRepositoryTest.php - - - - message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertIsArray\\(\\) with true will always evaluate to false\\.$#" - count: 1 - path: tests/Gedmo/Tree/RepositoryTest.php - diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 284d811dca..ae95c956a6 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -12,12 +12,12 @@ parameters: - tests/bootstrap.php treatPhpDocTypesAsCertain: false ignoreErrors: + - + identifier: trait.unused - '#^Property Gedmo\\Tests\\.+\\Fixture\\[^:]+::\$\w+ is never written, only read\.$#' - '#^Property Gedmo\\Tests\\.+\\Fixture\\[^:]+::\$\w+ is never read, only written\.$#' - '#^Property Gedmo\\Tests\\.+\\Fixture\\[^:]+::\$\w+ is unused\.$#' - '#^Method Gedmo\\(?:[^\\]+\\)*Mapping\\Driver[^:]+::readExtendedMetadata\(\) with return type void returns [\w\|<>\s,]+ but should not return anything\.$#' - - '#^Method Gedmo\\Uploadable\\Mapping\\Validator::validateConfiguration\(\) with return type void returns array but should not return anything\.$#' - - '#^Result of static method Gedmo\\Uploadable\\Mapping\\Validator::validateConfiguration\(\) \(void\) is used\.$#' - '#^Result of method Gedmo\\Mapping\\Driver::readExtendedMetadata\(\) \(void\) is used\.$#' excludePaths: # Deprecated and unused class, interface does not exist as of 4.0 diff --git a/src/AbstractTrackingListener.php b/src/AbstractTrackingListener.php index e59e3b44b9..a818601ffc 100644 --- a/src/AbstractTrackingListener.php +++ b/src/AbstractTrackingListener.php @@ -28,10 +28,10 @@ /** * The AbstractTrackingListener provides generic functions for all listeners. * - * @phpstan-template TConfig of array - * @phpstan-template TEventAdapter of AdapterInterface + * @template TConfig of array + * @template TEventAdapter of AdapterInterface * - * @phpstan-extends MappedEventSubscriber + * @template-extends MappedEventSubscriber * * @author Gediminas Morkevicius */ @@ -207,9 +207,9 @@ public function prePersist(EventArgs $args) /** * Get the value for an updated field. * - * @param ClassMetadata $meta - * @param string $field - * @param AdapterInterface $eventAdapter + * @param ClassMetadata $meta + * @param string $field + * @param TEventAdapter $eventAdapter * * @return mixed */ @@ -218,10 +218,10 @@ abstract protected function getFieldValue($meta, $field, $eventAdapter); /** * Updates a field. * - * @param object $object - * @param AdapterInterface $eventAdapter - * @param ClassMetadata $meta - * @param string $field + * @param object $object + * @param TEventAdapter $eventAdapter + * @param ClassMetadata $meta + * @param string $field * * @return void */ diff --git a/src/Blameable/BlameableListener.php b/src/Blameable/BlameableListener.php index 46100d869b..dbffc4e846 100644 --- a/src/Blameable/BlameableListener.php +++ b/src/Blameable/BlameableListener.php @@ -34,8 +34,9 @@ class BlameableListener extends AbstractTrackingListener /** * Get the user value to set on a blameable field * - * @param ClassMetadata $meta - * @param string $field + * @param ClassMetadata $meta + * @param string $field + * @param BlameableAdapter $eventAdapter * * @return mixed */ diff --git a/src/Blameable/Mapping/Driver/Xml.php b/src/Blameable/Mapping/Driver/Xml.php index 42861f8e17..6286a1f856 100644 --- a/src/Blameable/Mapping/Driver/Xml.php +++ b/src/Blameable/Mapping/Driver/Xml.php @@ -119,8 +119,8 @@ public function readExtendedMetadata($meta, array &$config) /** * Checks if $field type is valid * - * @param ClassMetadata $meta - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return bool */ diff --git a/src/Blameable/Mapping/Driver/Yaml.php b/src/Blameable/Mapping/Driver/Yaml.php index e72b334890..affb171178 100644 --- a/src/Blameable/Mapping/Driver/Yaml.php +++ b/src/Blameable/Mapping/Driver/Yaml.php @@ -125,8 +125,8 @@ protected function _loadMappingFile($file) /** * Checks if $field type is valid * - * @param ClassMetadata $meta - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return bool */ diff --git a/src/IpTraceable/IpTraceableListener.php b/src/IpTraceable/IpTraceableListener.php index b8d1113b98..7c9c743f78 100644 --- a/src/IpTraceable/IpTraceableListener.php +++ b/src/IpTraceable/IpTraceableListener.php @@ -13,7 +13,6 @@ use Gedmo\AbstractTrackingListener; use Gedmo\Exception\InvalidArgumentException; use Gedmo\IpTraceable\Mapping\Event\IpTraceableAdapter; -use Gedmo\Mapping\Event\AdapterInterface; /** * The IpTraceable listener handles the update of @@ -35,9 +34,9 @@ class IpTraceableListener extends AbstractTrackingListener /** * Get the ipValue value to set on a ip field * - * @param ClassMetadata $meta - * @param string $field - * @param AdapterInterface $eventAdapter + * @param ClassMetadata $meta + * @param string $field + * @param IpTraceableAdapter $eventAdapter * * @return string|null */ diff --git a/src/IpTraceable/Mapping/Driver/Xml.php b/src/IpTraceable/Mapping/Driver/Xml.php index 9e64a9efd2..4fffb12107 100644 --- a/src/IpTraceable/Mapping/Driver/Xml.php +++ b/src/IpTraceable/Mapping/Driver/Xml.php @@ -121,8 +121,8 @@ public function readExtendedMetadata($meta, array &$config) /** * Checks if $field type is valid * - * @param ClassMetadata $meta - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return bool */ diff --git a/src/IpTraceable/Mapping/Driver/Yaml.php b/src/IpTraceable/Mapping/Driver/Yaml.php index 590969ea8d..4627419375 100644 --- a/src/IpTraceable/Mapping/Driver/Yaml.php +++ b/src/IpTraceable/Mapping/Driver/Yaml.php @@ -121,8 +121,8 @@ protected function _loadMappingFile($file) /** * Checks if $field type is valid * - * @param ClassMetadata $meta - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return bool */ diff --git a/src/Loggable/Entity/Repository/LogEntryRepository.php b/src/Loggable/Entity/Repository/LogEntryRepository.php index 9e3274f80c..ac0551865e 100644 --- a/src/Loggable/Entity/Repository/LogEntryRepository.php +++ b/src/Loggable/Entity/Repository/LogEntryRepository.php @@ -25,29 +25,25 @@ * * @author Gediminas Morkevicius * - * @phpstan-template T of Loggable|object + * @template T of Loggable|object * - * @phpstan-extends EntityRepository> + * @template-extends EntityRepository> */ class LogEntryRepository extends EntityRepository { /** * Currently used loggable listener * - * @phpstan-var LoggableListener|null + * @var LoggableListener|null */ private ?LoggableListener $listener = null; /** * Loads all log entries for the given entity * - * @param object $entity + * @param T $entity * - * @return AbstractLogEntry[] - * - * @phpstan-param T $entity - * - * @phpstan-return array> + * @return array> */ public function getLogEntries($entity) { @@ -57,11 +53,9 @@ public function getLogEntries($entity) /** * Get the query for loading of log entries * - * @param object $entity + * @param T $entity * * @return Query - * - * @phpstan-param T $entity */ public function getLogEntriesQuery($entity) { @@ -89,14 +83,12 @@ public function getLogEntriesQuery($entity) * After this operation you will need to * persist and flush the $entity. * - * @param object $entity - * @param int $version + * @param T $entity + * @param int $version * * @throws UnexpectedValueException * * @return void - * - * @phpstan-param T $entity */ public function revert($entity, $version = 1) { @@ -151,12 +143,11 @@ public function revert($entity, $version = 1) } /** - * @param string $field - * @param mixed $value + * @param ClassMetadata $objectMeta + * @param string $field + * @param mixed $value * * @return void - * - * @phpstan-param ClassMetadata $objectMeta */ protected function mapValue(ClassMetadata $objectMeta, $field, &$value) { @@ -173,7 +164,7 @@ protected function mapValue(ClassMetadata $objectMeta, $field, &$value) * * @throws RuntimeException if listener is not found * - * @phpstan-return LoggableListener + * @return LoggableListener */ private function getLoggableListener(): LoggableListener { diff --git a/src/Loggable/LoggableListener.php b/src/Loggable/LoggableListener.php index 0068372b87..0054479034 100644 --- a/src/Loggable/LoggableListener.php +++ b/src/Loggable/LoggableListener.php @@ -34,7 +34,7 @@ * versioned?: string[], * } * - * @phpstan-template T of Loggable|object + * @template T of Loggable|object * * @phpstan-extends MappedEventSubscriber */ diff --git a/src/Loggable/Mapping/Driver/Attribute.php b/src/Loggable/Mapping/Driver/Attribute.php index 326310f7e4..c72b70570c 100644 --- a/src/Loggable/Mapping/Driver/Attribute.php +++ b/src/Loggable/Mapping/Driver/Attribute.php @@ -10,6 +10,7 @@ namespace Gedmo\Loggable\Mapping\Driver; use Doctrine\ODM\MongoDB\Mapping\ClassMetadata as ClassMetadataODM; +use Doctrine\ORM\Mapping\ClassMetadata as ClassMetadataORM; use Doctrine\Persistence\Mapping\ClassMetadata; use Gedmo\Exception\InvalidMappingException; use Gedmo\Mapping\Annotation\Loggable; @@ -38,7 +39,7 @@ class Attribute extends AbstractAnnotationDriver public function validateFullMetadata(ClassMetadata $meta, array $config) { - if ($config && $meta instanceof ClassMetadataODM && is_array($meta->getIdentifier()) && count($meta->getIdentifier()) > 1) { + if ($config && $meta instanceof ClassMetadataODM && count($meta->getIdentifier()) > 1) { throw new InvalidMappingException("Loggable does not support composite identifiers in class - {$meta->getName()}"); } @@ -94,7 +95,7 @@ public function readExtendedMetadata($meta, array &$config) } if (!$meta->isMappedSuperclass && $config) { - if ($meta instanceof ClassMetadataODM && is_array($meta->getIdentifier()) && count($meta->getIdentifier()) > 1) { + if ($meta instanceof ClassMetadataODM && count($meta->getIdentifier()) > 1) { throw new InvalidMappingException("Loggable does not support composite identifiers in class - {$meta->getName()}"); } @@ -107,7 +108,8 @@ public function readExtendedMetadata($meta, array &$config) } /** - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return bool */ @@ -117,7 +119,8 @@ protected function isMappingValid(ClassMetadata $meta, $field) } /** - * @param array $config + * @param ClassMetadata $meta + * @param array $config * * @return bool */ @@ -129,9 +132,10 @@ protected function isClassAnnotationInValid(ClassMetadata $meta, array &$config) /** * Searches properties of embedded objects for versioned fields * - * @param array $config + * @param array $config + * @param ClassMetadataORM $meta */ - private function inspectEmbeddedForVersioned(string $field, array &$config, \Doctrine\ORM\Mapping\ClassMetadata $meta): void + private function inspectEmbeddedForVersioned(string $field, array &$config, ClassMetadataORM $meta): void { $class = new \ReflectionClass($meta->embeddedClasses[$field]['class']); diff --git a/src/Loggable/Mapping/Driver/Xml.php b/src/Loggable/Mapping/Driver/Xml.php index 9516c1e28e..cd00c02da9 100644 --- a/src/Loggable/Mapping/Driver/Xml.php +++ b/src/Loggable/Mapping/Driver/Xml.php @@ -41,7 +41,7 @@ public function readExtendedMetadata($meta, array &$config) if (in_array($xmlDoctrine->getName(), ['mapped-superclass', 'entity', 'document'], true)) { if (isset($xml->loggable)) { /** - * @var \SimpleXMLElement; + * @var \SimpleXMLElement */ $data = $xml->loggable; $config['loggable'] = true; @@ -75,7 +75,7 @@ public function readExtendedMetadata($meta, array &$config) } if (!$meta->isMappedSuperclass && $config) { - if ($meta instanceof ClassMetadataODM && is_array($meta->getIdentifier()) && count($meta->getIdentifier()) > 1) { + if ($meta instanceof ClassMetadataODM && count($meta->getIdentifier()) > 1) { throw new InvalidMappingException("Loggable does not support composite identifiers in class - {$meta->getName()}"); } if (isset($config['versioned']) && !isset($config['loggable'])) { @@ -89,7 +89,8 @@ public function readExtendedMetadata($meta, array &$config) /** * Searches mappings on element for versioned fields * - * @param array $config + * @param array $config + * @param ClassMetadata $meta * * @return array */ diff --git a/src/Loggable/Mapping/Driver/Yaml.php b/src/Loggable/Mapping/Driver/Yaml.php index 9c4e556c90..7863059de6 100644 --- a/src/Loggable/Mapping/Driver/Yaml.php +++ b/src/Loggable/Mapping/Driver/Yaml.php @@ -125,7 +125,7 @@ public function readExtendedMetadata($meta, array &$config) } if (!$meta->isMappedSuperclass && $config) { - if ($meta instanceof ClassMetadata && is_array($meta->getIdentifier()) && count($meta->getIdentifier()) > 1) { + if ($meta instanceof ClassMetadata && count($meta->getIdentifier()) > 1) { throw new InvalidMappingException("Loggable does not support composite identifiers in class - {$meta->getName()}"); } if (isset($config['versioned']) && !isset($config['loggable'])) { diff --git a/src/Loggable/Mapping/Event/Adapter/ODM.php b/src/Loggable/Mapping/Event/Adapter/ODM.php index 1d501aa9c2..d193949591 100644 --- a/src/Loggable/Mapping/Event/Adapter/ODM.php +++ b/src/Loggable/Mapping/Event/Adapter/ODM.php @@ -9,6 +9,7 @@ namespace Gedmo\Loggable\Mapping\Event\Adapter; +use Doctrine\ODM\MongoDB\Mapping\ClassMetadata; use Gedmo\Loggable\Document\LogEntry; use Gedmo\Loggable\Mapping\Event\LoggableAdapter; use Gedmo\Mapping\Event\Adapter\ODM as BaseAdapterODM; @@ -26,11 +27,17 @@ public function getDefaultLogEntryClass() return LogEntry::class; } + /** + * @param ClassMetadata $meta + */ public function isPostInsertGenerator($meta) { return false; } + /** + * @param ClassMetadata $meta + */ public function getNewVersion($meta, $object) { $dm = $this->getObjectManager(); diff --git a/src/Loggable/Mapping/Event/Adapter/ORM.php b/src/Loggable/Mapping/Event/Adapter/ORM.php index b30fe9c8ba..83fcac8ad4 100644 --- a/src/Loggable/Mapping/Event/Adapter/ORM.php +++ b/src/Loggable/Mapping/Event/Adapter/ORM.php @@ -29,13 +29,16 @@ public function getDefaultLogEntryClass() } /** - * @param ClassMetadata $meta + * @param ClassMetadata $meta */ public function isPostInsertGenerator($meta) { return $meta->idGenerator->isPostInsertGenerator(); } + /** + * @param ClassMetadata $meta + */ public function getNewVersion($meta, $object) { $em = $this->getObjectManager(); diff --git a/src/Loggable/Mapping/Event/LoggableAdapter.php b/src/Loggable/Mapping/Event/LoggableAdapter.php index ac5b3f27eb..bc960d72bb 100644 --- a/src/Loggable/Mapping/Event/LoggableAdapter.php +++ b/src/Loggable/Mapping/Event/LoggableAdapter.php @@ -31,7 +31,7 @@ public function getDefaultLogEntryClass(); /** * Checks whether an identifier should be generated post insert. * - * @param ClassMetadata $meta + * @param ClassMetadata $meta * * @return bool */ @@ -40,8 +40,8 @@ public function isPostInsertGenerator($meta); /** * Get the new version number for an object. * - * @param ClassMetadata $meta - * @param object $object + * @param ClassMetadata $meta + * @param object $object * * @return int */ diff --git a/src/Mapping/Driver.php b/src/Mapping/Driver.php index 7effdf54ae..fb08c6a15c 100644 --- a/src/Mapping/Driver.php +++ b/src/Mapping/Driver.php @@ -28,14 +28,16 @@ interface Driver * * @todo In the next major release stop receiving by reference the `$config` parameter and use `array` as return type declaration * - * @param ClassMetadata $meta + * @param ClassMetadata $meta * @param array $config * * @throws InvalidMappingException if the mapping configuration is invalid * * @return void * - * @phpstan-param ClassMetadata&(OdmClassMetadata|OrmClassMetadata) $meta + * @template T of object + * + * @phpstan-param ClassMetadata&(OdmClassMetadata|OrmClassMetadata) $meta */ public function readExtendedMetadata($meta, array &$config); diff --git a/src/Mapping/Driver/AbstractAnnotationDriver.php b/src/Mapping/Driver/AbstractAnnotationDriver.php index 43c92deae3..2d3c1354fc 100644 --- a/src/Mapping/Driver/AbstractAnnotationDriver.php +++ b/src/Mapping/Driver/AbstractAnnotationDriver.php @@ -99,11 +99,9 @@ public function setOriginalDriver($driver) } /** - * @param ClassMetadata $meta + * @param ClassMetadata $meta * - * @return \ReflectionClass - * - * @phpstan-return \ReflectionClass + * @return \ReflectionClass */ public function getMetaReflectionClass($meta) { @@ -111,7 +109,8 @@ public function getMetaReflectionClass($meta) } /** - * @param array $config + * @param ClassMetadata $meta + * @param array $config * * @return void */ @@ -122,8 +121,8 @@ public function validateFullMetadata(ClassMetadata $meta, array $config) /** * Checks if $field type is valid * - * @param ClassMetadata $meta - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return bool */ @@ -137,8 +136,8 @@ protected function isValidField($meta, $field) /** * Try to find out related class name out of mapping * - * @param ClassMetadata $metadata the mapped class metadata - * @param string $name the related object class name + * @param ClassMetadata $metadata the mapped class metadata + * @param string $name the related object class name * * @return string related class name or empty string if does not exist * diff --git a/src/Mapping/Driver/File.php b/src/Mapping/Driver/File.php index 116bd1a8d0..188cc9d369 100644 --- a/src/Mapping/Driver/File.php +++ b/src/Mapping/Driver/File.php @@ -140,8 +140,8 @@ protected function _getMapping($className) /** * Try to find out related class name out of mapping * - * @param ClassMetadata $metadata the mapped class metadata - * @param string $name the related object class name + * @param ClassMetadata $metadata the mapped class metadata + * @param string $name the related object class name * * @return string related class name or empty string if does not exist * diff --git a/src/Mapping/Event/Adapter/ODM.php b/src/Mapping/Event/Adapter/ODM.php index ccab880c07..d86fdb1c0c 100644 --- a/src/Mapping/Event/Adapter/ODM.php +++ b/src/Mapping/Event/Adapter/ODM.php @@ -62,7 +62,7 @@ public function getManagerName() } /** - * @param ClassMetadata $meta + * @param ClassMetadata $meta */ public function getRootObjectClass($meta) { @@ -114,11 +114,17 @@ public function getObjectChangeSet($uow, $object) return $uow->getDocumentChangeSet($object); } + /** + * @param ClassMetadata $meta + */ public function getSingleIdentifierFieldName($meta) { return $meta->getIdentifier()[0]; } + /** + * @param ClassMetadata $meta + */ public function recomputeSingleObjectChangeSet($uow, $meta, $object) { $uow->recomputeSingleDocumentChangeSet($meta, $object); diff --git a/src/Mapping/Event/Adapter/ORM.php b/src/Mapping/Event/Adapter/ORM.php index 844fa6acc7..bca7cbade6 100644 --- a/src/Mapping/Event/Adapter/ORM.php +++ b/src/Mapping/Event/Adapter/ORM.php @@ -62,7 +62,7 @@ public function getManagerName() } /** - * @param ClassMetadata $meta + * @param ClassMetadata $meta */ public function getRootObjectClass($meta) { @@ -149,13 +149,16 @@ public function getObjectChangeSet($uow, $object) } /** - * @param ClassMetadata $meta + * @param ClassMetadata $meta */ public function getSingleIdentifierFieldName($meta) { return $meta->getSingleIdentifierFieldName(); } + /** + * @param ClassMetadata $meta + */ public function recomputeSingleObjectChangeSet($uow, $meta, $object) { $uow->recomputeSingleEntityChangeSet($meta, $object); diff --git a/src/Mapping/Event/AdapterInterface.php b/src/Mapping/Event/AdapterInterface.php index 339a54f3ea..7ce0f2f1a4 100644 --- a/src/Mapping/Event/AdapterInterface.php +++ b/src/Mapping/Event/AdapterInterface.php @@ -21,8 +21,8 @@ * * @author Gediminas Morkevicius * - * @method LifecycleEventArgs createLifecycleEventArgsInstance(object $object, ObjectManager $manager) @deprecated - * @method object getObject() + * @method LifecycleEventArgs createLifecycleEventArgsInstance(object $object, ObjectManager $manager) @deprecated + * @method object getObject() */ interface AdapterInterface { @@ -62,7 +62,7 @@ public function getManagerName(); /** * Get the root object class, handles inheritance * - * @param ClassMetadata $meta + * @param ClassMetadata $meta * * @return string * @@ -102,7 +102,7 @@ public function getObjectChangeSet($uow, $object); /** * Get the single identifier field name. * - * @param ClassMetadata $meta + * @param ClassMetadata $meta * * @return string */ @@ -114,7 +114,7 @@ public function getSingleIdentifierFieldName($meta); * of work's commit. * * @param ORMUnitOfWork|MongoDBUnitOfWork $uow The UnitOfWork as provided by the object manager - * @param ClassMetadata $meta + * @param ClassMetadata $meta * @param object $object * * @return void diff --git a/src/Mapping/ExtensionMetadataFactory.php b/src/Mapping/ExtensionMetadataFactory.php index ccfd4fcd15..16d321cc3f 100644 --- a/src/Mapping/ExtensionMetadataFactory.php +++ b/src/Mapping/ExtensionMetadataFactory.php @@ -109,7 +109,7 @@ public function __construct(ObjectManager $objectManager, string $extensionNames /** * Reads extension metadata * - * @param ClassMetadata&(DocumentClassMetadata|EntityClassMetadata|LegacyEntityClassMetadata) $meta + * @param ClassMetadata&(DocumentClassMetadata|EntityClassMetadata|LegacyEntityClassMetadata) $meta * * @return array the metadata configuration */ diff --git a/src/Mapping/MappedEventSubscriber.php b/src/Mapping/MappedEventSubscriber.php index 23b6a42ead..d5b87c5388 100644 --- a/src/Mapping/MappedEventSubscriber.php +++ b/src/Mapping/MappedEventSubscriber.php @@ -228,7 +228,7 @@ final public function setClock(ClockInterface $clock): void * Scans the objects for extended annotations * event subscribers must subscribe to loadClassMetadata event * - * @param ClassMetadata $metadata + * @param ClassMetadata $metadata * * @return void */ diff --git a/src/Sluggable/Handler/InversedRelativeSlugHandler.php b/src/Sluggable/Handler/InversedRelativeSlugHandler.php index 493b23f593..c68f191aba 100644 --- a/src/Sluggable/Handler/InversedRelativeSlugHandler.php +++ b/src/Sluggable/Handler/InversedRelativeSlugHandler.php @@ -59,6 +59,9 @@ public function postSlugBuild(SluggableAdapter $ea, array &$config, $object, &$s { } + /** + * @param ClassMetadata $meta + */ public static function validate(array $options, ClassMetadata $meta) { if (!isset($options['relationClass']) || !strlen($options['relationClass'])) { diff --git a/src/Sluggable/Handler/RelativeSlugHandler.php b/src/Sluggable/Handler/RelativeSlugHandler.php index e2afda825a..802806c651 100644 --- a/src/Sluggable/Handler/RelativeSlugHandler.php +++ b/src/Sluggable/Handler/RelativeSlugHandler.php @@ -90,6 +90,9 @@ public function postSlugBuild(SluggableAdapter $ea, array &$config, $object, &$s $this->sluggable->setTransliterator([$this, 'transliterate']); } + /** + * @param ClassMetadata $meta + */ public static function validate(array $options, ClassMetadata $meta) { if (!$meta->isSingleValuedAssociation($options['relationField'])) { diff --git a/src/Sluggable/Handler/SlugHandlerInterface.php b/src/Sluggable/Handler/SlugHandlerInterface.php index 045151bdf4..455a38c4c5 100644 --- a/src/Sluggable/Handler/SlugHandlerInterface.php +++ b/src/Sluggable/Handler/SlugHandlerInterface.php @@ -34,10 +34,12 @@ public function __construct(SluggableListener $sluggable); * Hook on slug handlers before the decision is made whether * the slug needs to be recalculated. * - * @param SlugConfiguration $config - * @param object $object - * @param string $slug - * @param bool $needToChangeSlug + * @param array $config + * @param object $object + * @param string $slug + * @param bool $needToChangeSlug + * + * @phpstan-param SlugConfiguration $config * * @return void */ @@ -46,9 +48,11 @@ public function onChangeDecision(SluggableAdapter $ea, array &$config, $object, /** * Hook on slug handlers called after the slug is built. * - * @param SlugConfiguration $config - * @param object $object - * @param string $slug + * @param array $config + * @param object $object + * @param string $slug + * + * @phpstan-param SlugConfiguration $config * * @return void */ @@ -57,9 +61,11 @@ public function postSlugBuild(SluggableAdapter $ea, array &$config, $object, &$s /** * Hook for slug handlers called after the slug is completed. * - * @param SlugConfiguration $config - * @param object $object - * @param string $slug + * @param array $config + * @param object $object + * @param string $slug + * + * @phpstan-param SlugConfiguration $config * * @return void */ @@ -73,7 +79,8 @@ public function handlesUrlization(); /** * Validates the options for the handler. * - * @param array $options + * @param array $options + * @param ClassMetadata $meta * * @throws InvalidMappingException if the configuration is invalid * diff --git a/src/Sluggable/Handler/TreeSlugHandler.php b/src/Sluggable/Handler/TreeSlugHandler.php index c807306593..8ddbb97635 100644 --- a/src/Sluggable/Handler/TreeSlugHandler.php +++ b/src/Sluggable/Handler/TreeSlugHandler.php @@ -115,6 +115,9 @@ public function postSlugBuild(SluggableAdapter $ea, array &$config, $object, &$s } } + /** + * @param ClassMetadata $meta + */ public static function validate(array $options, ClassMetadata $meta) { if (!$meta->isSingleValuedAssociation($options['parentRelationField'])) { diff --git a/src/Sluggable/Mapping/Driver/Annotation.php b/src/Sluggable/Mapping/Driver/Annotation.php index 5bde6016ab..9f076d6f37 100644 --- a/src/Sluggable/Mapping/Driver/Annotation.php +++ b/src/Sluggable/Mapping/Driver/Annotation.php @@ -29,6 +29,8 @@ class Annotation extends Attribute implements AnnotationDriverInterface { /** + * @param ClassMetadata $meta + * * @return array, SlugHandler[]> */ protected function getSlugHandlers(\ReflectionProperty $property, Slug $slug, ClassMetadata $meta): array diff --git a/src/Sluggable/Mapping/Driver/Attribute.php b/src/Sluggable/Mapping/Driver/Attribute.php index 0a1880fb31..72fc94a22d 100644 --- a/src/Sluggable/Mapping/Driver/Attribute.php +++ b/src/Sluggable/Mapping/Driver/Attribute.php @@ -94,6 +94,8 @@ public function readExtendedMetadata($meta, array &$config) } /** + * @param ClassMetadata $meta + * * @return array, SlugHandler[]> */ protected function getSlugHandlers(\ReflectionProperty $property, Slug $slug, ClassMetadata $meta): array @@ -128,7 +130,8 @@ protected function getSlugHandlers(\ReflectionProperty $property, Slug $slug, Cl } /** - * @param array $config + * @param ClassMetadata $meta + * @param array $config * * @return array> */ @@ -173,18 +176,6 @@ private function retrieveSlug(ClassMetadata $meta, array &$config, \ReflectionPr } } - if (!is_bool($slug->updatable)) { - throw new InvalidMappingException("Slug annotation [updatable], type is not valid and must be 'boolean' in class - {$meta->getName()}"); - } - - if (!is_bool($slug->unique)) { - throw new InvalidMappingException("Slug annotation [unique], type is not valid and must be 'boolean' in class - {$meta->getName()}"); - } - - if (!is_bool($slug->uniqueOverTranslations)) { - throw new InvalidMappingException("Slug annotation [uniqueOverTranslations], type is not valid and must be 'boolean' in class - {$meta->getName()}"); - } - if ([] !== $meta->getIdentifier() && $meta->isIdentifier($fieldName) && !(bool) $slug->unique) { throw new InvalidMappingException("Identifier field - [{$fieldName}] slug must be unique in order to maintain primary key in class - {$meta->getName()}"); } diff --git a/src/Sluggable/Mapping/Driver/Xml.php b/src/Sluggable/Mapping/Driver/Xml.php index a54976b85d..05fcd9117a 100644 --- a/src/Sluggable/Mapping/Driver/Xml.php +++ b/src/Sluggable/Mapping/Driver/Xml.php @@ -67,8 +67,8 @@ public function readExtendedMetadata($meta, array &$config) /** * Checks if $field type is valid as Sluggable field * - * @param ClassMetadata $meta - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return bool */ @@ -80,7 +80,8 @@ protected function isValidField($meta, $field) } /** - * @param array $config + * @param ClassMetadata $meta + * @param array $config * * @return array */ diff --git a/src/Sluggable/Mapping/Driver/Yaml.php b/src/Sluggable/Mapping/Driver/Yaml.php index eddc7c9c5f..831ff17d41 100644 --- a/src/Sluggable/Mapping/Driver/Yaml.php +++ b/src/Sluggable/Mapping/Driver/Yaml.php @@ -76,8 +76,8 @@ protected function _loadMappingFile($file) /** * Checks if $field type is valid as Sluggable field * - * @param ClassMetadata $meta - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return bool */ @@ -89,8 +89,9 @@ protected function isValidField($meta, $field) } /** - * @param array $fieldMapping - * @param array $config + * @param array $fieldMapping + * @param ClassMetadata $meta + * @param array $config * * @return array */ diff --git a/src/Sluggable/Mapping/Event/Adapter/ORM.php b/src/Sluggable/Mapping/Event/Adapter/ORM.php index 62a65f2dab..2b7a543845 100644 --- a/src/Sluggable/Mapping/Event/Adapter/ORM.php +++ b/src/Sluggable/Mapping/Event/Adapter/ORM.php @@ -32,7 +32,7 @@ class ORM extends BaseAdapterORM implements SluggableAdapter public function getSimilarSlugs($object, $meta, array $config, $slug) { $em = $this->getObjectManager(); - /** @var EntityWrapper $wrapped */ + /** @var EntityWrapper $wrapped */ $wrapped = AbstractWrapper::wrap($object, $em); $qb = $em->createQueryBuilder(); $qb->select('rec.'.$config['slug']) diff --git a/src/Sluggable/Mapping/Event/SluggableAdapter.php b/src/Sluggable/Mapping/Event/SluggableAdapter.php index ee46a219e5..6380863326 100644 --- a/src/Sluggable/Mapping/Event/SluggableAdapter.php +++ b/src/Sluggable/Mapping/Event/SluggableAdapter.php @@ -26,9 +26,9 @@ interface SluggableAdapter extends AdapterInterface /** * Loads the similar slugs for a managed object. * - * @param object $object - * @param ClassMetadata $meta - * @param string $slug + * @param object $object + * @param ClassMetadata $meta + * @param string $slug * * @phpstan-param SlugConfiguration $config * diff --git a/src/SoftDeleteable/Mapping/Event/Adapter/ODM.php b/src/SoftDeleteable/Mapping/Event/Adapter/ODM.php index 1640e853da..7311463514 100644 --- a/src/SoftDeleteable/Mapping/Event/Adapter/ODM.php +++ b/src/SoftDeleteable/Mapping/Event/Adapter/ODM.php @@ -34,7 +34,7 @@ public function setClock(ClockInterface $clock): void } /** - * @param ClassMetadata $meta + * @param ClassMetadata $meta */ public function getDateValue($meta, $field) { diff --git a/src/SoftDeleteable/Mapping/Event/Adapter/ORM.php b/src/SoftDeleteable/Mapping/Event/Adapter/ORM.php index 46d31be7e7..069139b2ea 100644 --- a/src/SoftDeleteable/Mapping/Event/Adapter/ORM.php +++ b/src/SoftDeleteable/Mapping/Event/Adapter/ORM.php @@ -36,7 +36,7 @@ public function setClock(ClockInterface $clock): void } /** - * @param ClassMetadata $meta + * @param ClassMetadata $meta */ public function getDateValue($meta, $field) { diff --git a/src/SoftDeleteable/Mapping/Event/SoftDeleteableAdapter.php b/src/SoftDeleteable/Mapping/Event/SoftDeleteableAdapter.php index a855c58c79..18ba3f7125 100644 --- a/src/SoftDeleteable/Mapping/Event/SoftDeleteableAdapter.php +++ b/src/SoftDeleteable/Mapping/Event/SoftDeleteableAdapter.php @@ -22,8 +22,8 @@ interface SoftDeleteableAdapter extends AdapterInterface /** * Get the date value. * - * @param ClassMetadata $meta - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return int|\DateTimeInterface */ diff --git a/src/SoftDeleteable/Mapping/Validator.php b/src/SoftDeleteable/Mapping/Validator.php index 0f138e2504..c69909a408 100644 --- a/src/SoftDeleteable/Mapping/Validator.php +++ b/src/SoftDeleteable/Mapping/Validator.php @@ -40,7 +40,8 @@ class Validator ]; /** - * @param mixed $field + * @param ClassMetadata $meta + * @param mixed $field * * @return void */ diff --git a/src/SoftDeleteable/Query/TreeWalker/Exec/MultiTableDeleteExecutor.php b/src/SoftDeleteable/Query/TreeWalker/Exec/MultiTableDeleteExecutor.php index 94157970d5..fbe7935fd5 100644 --- a/src/SoftDeleteable/Query/TreeWalker/Exec/MultiTableDeleteExecutor.php +++ b/src/SoftDeleteable/Query/TreeWalker/Exec/MultiTableDeleteExecutor.php @@ -26,7 +26,8 @@ class MultiTableDeleteExecutor extends BaseMultiTableDeleteExecutor { /** - * @param array $config + * @param ClassMetadata $meta + * @param array $config */ public function __construct(Node $AST, $sqlWalker, ClassMetadata $meta, AbstractPlatform $platform, array $config) { diff --git a/src/SoftDeleteable/Query/TreeWalker/SoftDeleteableWalker.php b/src/SoftDeleteable/Query/TreeWalker/SoftDeleteableWalker.php index 6f8de3ce72..10e7e1c4b5 100644 --- a/src/SoftDeleteable/Query/TreeWalker/SoftDeleteableWalker.php +++ b/src/SoftDeleteable/Query/TreeWalker/SoftDeleteableWalker.php @@ -77,7 +77,7 @@ class SoftDeleteableWalker extends SqlWalker protected $deletedAtField; /** - * @var ClassMetadata + * @var ClassMetadata */ protected $meta; diff --git a/src/Sortable/Entity/Repository/SortableRepository.php b/src/Sortable/Entity/Repository/SortableRepository.php index 41a5451323..2a475d556c 100644 --- a/src/Sortable/Entity/Repository/SortableRepository.php +++ b/src/Sortable/Entity/Repository/SortableRepository.php @@ -22,7 +22,9 @@ * * @author Lukas Botsch * - * @phpstan-extends EntityRepository + * @template T of object + * + * @template-extends EntityRepository */ class SortableRepository extends EntityRepository { @@ -39,10 +41,13 @@ class SortableRepository extends EntityRepository protected $config; /** - * @var ClassMetadata + * @var ClassMetadata */ protected $meta; + /** + * @param ClassMetadata $class + */ public function __construct(EntityManagerInterface $em, ClassMetadata $class) { parent::__construct($em, $class); diff --git a/src/Sortable/Mapping/Driver/Xml.php b/src/Sortable/Mapping/Driver/Xml.php index 658e692c36..e2a7a03357 100644 --- a/src/Sortable/Mapping/Driver/Xml.php +++ b/src/Sortable/Mapping/Driver/Xml.php @@ -81,8 +81,8 @@ public function readExtendedMetadata($meta, array &$config) /** * Checks if $field type is valid as Sortable Position field * - * @param ClassMetadata $meta - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return bool */ diff --git a/src/Sortable/Mapping/Driver/Yaml.php b/src/Sortable/Mapping/Driver/Yaml.php index d09d815ab7..ae6d4074ac 100644 --- a/src/Sortable/Mapping/Driver/Yaml.php +++ b/src/Sortable/Mapping/Driver/Yaml.php @@ -88,8 +88,8 @@ protected function _loadMappingFile($file) /** * Checks if $field type is valid as SortablePosition field * - * @param ClassMetadata $meta - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return bool */ diff --git a/src/Sortable/Mapping/Event/Adapter/ODM.php b/src/Sortable/Mapping/Event/Adapter/ODM.php index d293dfc148..31862c3715 100644 --- a/src/Sortable/Mapping/Event/Adapter/ODM.php +++ b/src/Sortable/Mapping/Event/Adapter/ODM.php @@ -13,20 +13,26 @@ use Doctrine\ODM\MongoDB\Mapping\ClassMetadata; use Gedmo\Mapping\Event\Adapter\ODM as BaseAdapterODM; use Gedmo\Sortable\Mapping\Event\SortableAdapter; +use Gedmo\Sortable\SortableListener; /** * Doctrine event adapter for ODM adapted * for sortable behavior * * @author Lukas Botsch + * + * @phpstan-import-type SortableConfiguration from SortableListener + * @phpstan-import-type SortableRelocation from SortableListener */ final class ODM extends BaseAdapterODM implements SortableAdapter { /** * @param array $config - * @param ClassMetadata $meta + * @param ClassMetadata $meta * @param iterable $groups * + * @phpstan-param SortableConfiguration $config + * * @return int */ public function getMaxPosition(array $config, $meta, $groups) @@ -56,6 +62,9 @@ public function getMaxPosition(array $config, $meta, $groups) * @param array $delta * @param array $config * + * @phpstan-param SortableRelocation $relocation + * @phpstan-param SortableConfiguration $config + * * @return void */ public function updatePositions($relocation, $delta, $config) diff --git a/src/Sortable/Mapping/Event/Adapter/ORM.php b/src/Sortable/Mapping/Event/Adapter/ORM.php index 22b977c875..4331ffbe57 100644 --- a/src/Sortable/Mapping/Event/Adapter/ORM.php +++ b/src/Sortable/Mapping/Event/Adapter/ORM.php @@ -21,15 +21,18 @@ * * @author Lukas Botsch * + * @phpstan-import-type SortableConfiguration from SortableListener * @phpstan-import-type SortableRelocation from SortableListener */ final class ORM extends BaseAdapterORM implements SortableAdapter { /** * @param array $config - * @param ClassMetadata $meta + * @param ClassMetadata $meta * @param iterable $groups * + * @phpstan-param SortableConfiguration $config + * * @return int|null */ public function getMaxPosition(array $config, $meta, $groups) @@ -53,7 +56,8 @@ public function getMaxPosition(array $config, $meta, $groups) * @param array $delta * @param array $config * - * @phpstan-param SortableRelocation $relocation + * @phpstan-param SortableRelocation $relocation + * @phpstan-param SortableConfiguration $config * * @return void */ @@ -115,6 +119,7 @@ public function updatePositions($relocation, $delta, $config) } /** + * @param ClassMetadata $metadata * @param iterable $groups */ private function addGroupWhere(QueryBuilder $qb, ClassMetadata $metadata, iterable $groups): void diff --git a/src/Sortable/SortableListener.php b/src/Sortable/SortableListener.php index 39f3fb596c..d50c7f2ab9 100644 --- a/src/Sortable/SortableListener.php +++ b/src/Sortable/SortableListener.php @@ -345,9 +345,11 @@ public function postFlush(EventArgs $args) /** * Computes node positions and updates the sort field in memory and in the db * - * @param array $config - * @param ClassMetadata $meta - * @param object $object + * @param array $config + * @param ClassMetadata $meta + * @param object $object + * + * @phpstan-param SortableConfiguration $config * * @return void */ @@ -411,9 +413,11 @@ protected function processInsert(SortableAdapter $ea, array $config, $meta, $obj /** * Computes node positions and updates the sort field in memory and in the db * - * @param array $config - * @param ClassMetadata $meta - * @param object $object + * @param array $config + * @param ClassMetadata $meta + * @param object $object + * + * @phpstan-param SortableConfiguration $config * * @return void */ @@ -543,9 +547,11 @@ protected function processUpdate(SortableAdapter $ea, array $config, $meta, $obj /** * Computes node positions and updates the sort field in memory and in the db * - * @param array $config - * @param ClassMetadata $meta - * @param object $object + * @param array $config + * @param ClassMetadata $meta + * @param object $object + * + * @phpstan-param SortableConfiguration $config * * @return void */ @@ -597,6 +603,8 @@ protected function persistRelocations(SortableAdapter $ea) * @param array $groups * @param array $config * + * @phpstan-param SortableConfiguration $config + * * @return string */ protected function getHash($groups, array $config) @@ -615,10 +623,12 @@ protected function getHash($groups, array $config) } /** - * @param ClassMetadata $meta - * @param array $config - * @param object $object - * @param array $groups + * @param ClassMetadata $meta + * @param array $config + * @param object $object + * @param array $groups + * + * @phpstan-param SortableConfiguration $config * * @return int */ @@ -701,10 +711,12 @@ protected function addRelocation($hash, $class, $groups, $start, $stop, $delta, } /** - * @param ClassMetadata $meta + * @param ClassMetadata $meta * @param array> $config * @param object $object * + * @phpstan-param SortableConfiguration $config + * * @return array */ protected function getGroups($meta, $config, $object) diff --git a/src/Timestampable/Mapping/Driver/Xml.php b/src/Timestampable/Mapping/Driver/Xml.php index e94415ab42..f94b27fcee 100644 --- a/src/Timestampable/Mapping/Driver/Xml.php +++ b/src/Timestampable/Mapping/Driver/Xml.php @@ -96,8 +96,8 @@ public function readExtendedMetadata($meta, array &$config) /** * Checks if $field type is valid * - * @param ClassMetadata $meta - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return bool */ diff --git a/src/Timestampable/Mapping/Driver/Yaml.php b/src/Timestampable/Mapping/Driver/Yaml.php index 3c1600f734..5115584d6f 100644 --- a/src/Timestampable/Mapping/Driver/Yaml.php +++ b/src/Timestampable/Mapping/Driver/Yaml.php @@ -100,8 +100,8 @@ protected function _loadMappingFile($file) /** * Checks if $field type is valid * - * @param ClassMetadata $meta - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return bool */ diff --git a/src/Timestampable/Mapping/Event/Adapter/ODM.php b/src/Timestampable/Mapping/Event/Adapter/ODM.php index 8b9f5b9b2c..541e228b60 100644 --- a/src/Timestampable/Mapping/Event/Adapter/ODM.php +++ b/src/Timestampable/Mapping/Event/Adapter/ODM.php @@ -34,7 +34,7 @@ public function setClock(ClockInterface $clock): void } /** - * @param ClassMetadata $meta + * @param ClassMetadata $meta */ public function getDateValue($meta, $field) { diff --git a/src/Timestampable/Mapping/Event/Adapter/ORM.php b/src/Timestampable/Mapping/Event/Adapter/ORM.php index 4325127a44..fc6d2ba211 100644 --- a/src/Timestampable/Mapping/Event/Adapter/ORM.php +++ b/src/Timestampable/Mapping/Event/Adapter/ORM.php @@ -36,7 +36,7 @@ public function setClock(ClockInterface $clock): void } /** - * @param ClassMetadata $meta + * @param ClassMetadata $meta */ public function getDateValue($meta, $field) { diff --git a/src/Timestampable/Mapping/Event/TimestampableAdapter.php b/src/Timestampable/Mapping/Event/TimestampableAdapter.php index 74d4271a3a..c6e61458d3 100644 --- a/src/Timestampable/Mapping/Event/TimestampableAdapter.php +++ b/src/Timestampable/Mapping/Event/TimestampableAdapter.php @@ -22,8 +22,8 @@ interface TimestampableAdapter extends AdapterInterface /** * Get the date value. * - * @param ClassMetadata $meta - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return int|\DateTimeInterface */ diff --git a/src/Timestampable/TimestampableListener.php b/src/Timestampable/TimestampableListener.php index 22de2b1c78..8b6dfeb78c 100644 --- a/src/Timestampable/TimestampableListener.php +++ b/src/Timestampable/TimestampableListener.php @@ -26,9 +26,9 @@ class TimestampableListener extends AbstractTrackingListener { /** - * @param ClassMetadata $meta - * @param string $field - * @param TimestampableAdapter $eventAdapter + * @param ClassMetadata $meta + * @param string $field + * @param TimestampableAdapter $eventAdapter * * @return mixed */ diff --git a/src/Tool/Wrapper/AbstractWrapper.php b/src/Tool/Wrapper/AbstractWrapper.php index 8055069b93..19cbcc9196 100644 --- a/src/Tool/Wrapper/AbstractWrapper.php +++ b/src/Tool/Wrapper/AbstractWrapper.php @@ -11,9 +11,7 @@ use Doctrine\Deprecations\Deprecation; use Doctrine\ODM\MongoDB\DocumentManager; -use Doctrine\ODM\MongoDB\Mapping\ClassMetadata as OdmClassMetadata; use Doctrine\ORM\EntityManagerInterface; -use Doctrine\ORM\Mapping\ClassMetadata as OrmClassMetadata; use Doctrine\Persistence\Mapping\ClassMetadata; use Doctrine\Persistence\ObjectManager; use Gedmo\Exception\UnsupportedObjectManagerException; @@ -23,9 +21,11 @@ * Wraps entity or proxy for more convenient * manipulation * - * @phpstan-template TClassMetadata of ClassMetadata + * @template TClassMetadata of ClassMetadata + * @template TObject of object + * @template TObjectManager of ObjectManager * - * @phpstan-implements WrapperInterface + * @template-implements WrapperInterface * * @author Gediminas Morkevicius */ @@ -34,34 +34,36 @@ abstract class AbstractWrapper implements WrapperInterface /** * Object metadata * - * @var ClassMetadata&(OrmClassMetadata|OdmClassMetadata) - * - * @phpstan-var TClassMetadata + * @var TClassMetadata */ protected $meta; /** * Wrapped object * - * @var object + * @var TObject */ protected $object; /** * Object manager instance * - * @var ObjectManager + * @var TObjectManager */ protected $om; /** * Wrap object factory method * - * @param object $object + * @param TObject $object + * @param TObjectManager $om + * + * @psalm-param object $object + * @psalm-param ObjectManager $om * * @throws UnsupportedObjectManagerException * - * @return WrapperInterface + * @return WrapperInterface */ public static function wrap($object, ObjectManager $om) { @@ -88,11 +90,17 @@ public static function clear() ); } + /** + * @return TObject + */ public function getObject() { return $this->object; } + /** + * @return TClassMetadata + */ public function getMetadata() { return $this->meta; diff --git a/src/Tool/Wrapper/EntityWrapper.php b/src/Tool/Wrapper/EntityWrapper.php index 63bbe6187f..70dfe45005 100644 --- a/src/Tool/Wrapper/EntityWrapper.php +++ b/src/Tool/Wrapper/EntityWrapper.php @@ -18,7 +18,9 @@ * Wraps entity or proxy for more convenient * manipulation * - * @phpstan-extends AbstractWrapper + * @template TObject of object + * + * @template-extends AbstractWrapper, TObject, EntityManagerInterface> * * @author Gediminas Morkevicius * @@ -41,7 +43,7 @@ class EntityWrapper extends AbstractWrapper /** * Wrap entity * - * @param object $entity + * @param TObject $entity */ public function __construct($entity, EntityManagerInterface $em) { diff --git a/src/Tool/Wrapper/MongoDocumentWrapper.php b/src/Tool/Wrapper/MongoDocumentWrapper.php index 6744fc8222..18e3a54ce6 100644 --- a/src/Tool/Wrapper/MongoDocumentWrapper.php +++ b/src/Tool/Wrapper/MongoDocumentWrapper.php @@ -17,7 +17,9 @@ * Wraps document or proxy for more convenient * manipulation * - * @phpstan-extends AbstractWrapper + * @template TObject of object + * + * @template-extends AbstractWrapper, TObject, DocumentManager> * * @author Gediminas Morkevicius * @@ -38,7 +40,7 @@ class MongoDocumentWrapper extends AbstractWrapper /** * Wrap document * - * @param object $document + * @param TObject $document */ public function __construct($document, DocumentManager $dm) { diff --git a/src/Tool/WrapperInterface.php b/src/Tool/WrapperInterface.php index efa2eb6971..27551df27c 100644 --- a/src/Tool/WrapperInterface.php +++ b/src/Tool/WrapperInterface.php @@ -10,11 +10,14 @@ namespace Gedmo\Tool; use Doctrine\Persistence\Mapping\ClassMetadata; +use Doctrine\Persistence\ObjectManager; /** * Interface for a wrapper of a managed object. * - * @phpstan-template-covariant TClassMetadata of ClassMetadata + * @template-covariant TClassMetadata of ClassMetadata + * @template-covariant TObject of object + * @template-covariant TObjectManager of ObjectManager * * @author Gediminas Morkevicius */ @@ -23,7 +26,7 @@ interface WrapperInterface /** * Get the currently wrapped object. * - * @return object + * @return TObject */ public function getObject(); @@ -67,9 +70,7 @@ public function hasValidIdentifier(); /** * Get the object metadata. * - * @return ClassMetadata - * - * @phpstan-return TClassMetadata + * @return TClassMetadata */ public function getMetadata(); diff --git a/src/Translatable/Document/Repository/TranslationRepository.php b/src/Translatable/Document/Repository/TranslationRepository.php index a372d029a8..5dd18e1016 100644 --- a/src/Translatable/Document/Repository/TranslationRepository.php +++ b/src/Translatable/Document/Repository/TranslationRepository.php @@ -28,7 +28,9 @@ * * @author Gediminas Morkevicius * - * @phpstan-extends DocumentRepository + * @template T of object + * + * @template-extends DocumentRepository */ class TranslationRepository extends DocumentRepository { @@ -38,6 +40,9 @@ class TranslationRepository extends DocumentRepository */ private ?TranslatableListener $listener = null; + /** + * @param ClassMetadata $class + */ public function __construct(DocumentManager $dm, UnitOfWork $uow, ClassMetadata $class) { if ($class->getReflectionClass()->isSubclassOf(AbstractPersonalTranslation::class)) { diff --git a/src/Translatable/Mapping/Event/TranslatableAdapter.php b/src/Translatable/Mapping/Event/TranslatableAdapter.php index 555b87718b..4d4503f6b0 100644 --- a/src/Translatable/Mapping/Event/TranslatableAdapter.php +++ b/src/Translatable/Mapping/Event/TranslatableAdapter.php @@ -10,6 +10,7 @@ namespace Gedmo\Translatable\Mapping\Event; use Doctrine\Persistence\Mapping\ClassMetadata; +use Doctrine\Persistence\ObjectManager; use Gedmo\Mapping\Event\AdapterInterface; use Gedmo\Tool\Wrapper\AbstractWrapper; @@ -63,7 +64,7 @@ public function loadTranslations($object, $translationClass, $locale, $objectCla * @param string $translationClass * @param string $objectClass * - * @phpstan-param AbstractWrapper> $wrapped + * @phpstan-param AbstractWrapper, object, ObjectManager> $wrapped * @phpstan-param class-string $translationClass * @phpstan-param class-string $objectClass * @@ -77,7 +78,7 @@ public function findTranslation(AbstractWrapper $wrapped, $locale, $field, $tran * @param string $transClass * @param string $objectClass * - * @phpstan-param AbstractWrapper> $wrapped + * @phpstan-param AbstractWrapper, object, ObjectManager> $wrapped * @phpstan-param class-string $transClass * @phpstan-param class-string $objectClass * diff --git a/src/Translatable/Query/TreeWalker/TranslationWalker.php b/src/Translatable/Query/TreeWalker/TranslationWalker.php index 4801ad4d16..6193ac6d6b 100644 --- a/src/Translatable/Query/TreeWalker/TranslationWalker.php +++ b/src/Translatable/Query/TreeWalker/TranslationWalker.php @@ -84,7 +84,7 @@ class TranslationWalker extends SqlWalker * * @var array> * - * @phpstan-var array + * @phpstan-var array}> */ private array $translatedComponents = []; @@ -272,7 +272,7 @@ private function prepareTranslatedComponents(): void $joinStrategy = $q->getHint(TranslatableListener::HINT_INNER_JOIN) ? 'INNER' : 'LEFT'; foreach ($this->translatedComponents as $dqlAlias => $comp) { - /** @var ClassMetadata $meta */ + /** @var ClassMetadata $meta */ $meta = $comp['metadata']; $config = $this->listener->getConfiguration($em, $meta->getName()); $transClass = $this->listener->getTranslationClass($ea, $meta->getName()); @@ -349,9 +349,9 @@ private function needsFallback(): bool /** * Search for translated components in the select clause * - * @param array> $queryComponents + * @param array>> $queryComponents * - * @phpstan-param array $queryComponents + * @phpstan-param array}> $queryComponents */ private function extractTranslatedComponents(array $queryComponents): void { diff --git a/src/Translatable/TranslatableListener.php b/src/Translatable/TranslatableListener.php index d6e82805ed..44a04ef979 100644 --- a/src/Translatable/TranslatableListener.php +++ b/src/Translatable/TranslatableListener.php @@ -329,9 +329,9 @@ public function getListenerLocale() * Gets the locale to use for translation. Loads object * defined locale first. * - * @param object $object - * @param ClassMetadata $meta - * @param object $om + * @param object $object + * @param ClassMetadata $meta + * @param object $om * * @throws RuntimeException if language or locale property is not found in entity * diff --git a/src/Tree/Entity/Repository/NestedTreeRepository.php b/src/Tree/Entity/Repository/NestedTreeRepository.php index b5be94fd52..fe5bdf8337 100644 --- a/src/Tree/Entity/Repository/NestedTreeRepository.php +++ b/src/Tree/Entity/Repository/NestedTreeRepository.php @@ -1353,6 +1353,8 @@ private function verifyTree(array &$errors, ?object $root = null): void /** * Removes single node without touching children * + * @param EntityWrapper $wrapped + * * @internal */ private function removeSingle(EntityWrapper $wrapped): void diff --git a/src/Tree/Mapping/Validator.php b/src/Tree/Mapping/Validator.php index 20619b082d..ec41e24826 100644 --- a/src/Tree/Mapping/Validator.php +++ b/src/Tree/Mapping/Validator.php @@ -89,8 +89,8 @@ class Validator /** * Checks if $field type is valid * - * @param ClassMetadata $meta - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return bool */ @@ -104,8 +104,8 @@ public function isValidField($meta, $field) /** * Checks if $field type is valid for Path field * - * @param ClassMetadata $meta - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return bool */ @@ -119,8 +119,8 @@ public function isValidFieldForPath($meta, $field) /** * Checks if $field type is valid for PathSource field * - * @param ClassMetadata $meta - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return bool */ @@ -134,8 +134,8 @@ public function isValidFieldForPathSource($meta, $field) /** * Checks if $field type is valid for PathHash field * - * @param ClassMetadata $meta - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return bool */ @@ -149,8 +149,8 @@ public function isValidFieldForPathHash($meta, $field) /** * Checks if $field type is valid for LockTime field * - * @param ClassMetadata $meta - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return bool */ @@ -164,8 +164,8 @@ public function isValidFieldForLockTime($meta, $field) /** * Checks if $field type is valid for Root field * - * @param ClassMetadata $meta - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return bool */ @@ -179,8 +179,8 @@ public function isValidFieldForRoot($meta, $field) /** * Validates metadata for nested type tree * - * @param ClassMetadata $meta - * @param array $config + * @param ClassMetadata $meta + * @param array $config * * @throws InvalidMappingException * @@ -206,8 +206,8 @@ public function validateNestedTreeMetadata($meta, array $config) /** * Validates metadata for closure type tree * - * @param ClassMetadata $meta - * @param array $config + * @param ClassMetadata $meta + * @param array $config * * @throws InvalidMappingException * @@ -230,8 +230,8 @@ public function validateClosureTreeMetadata($meta, array $config) /** * Validates metadata for materialized path type tree * - * @param ClassMetadata $meta - * @param array $config + * @param ClassMetadata $meta + * @param array $config * * @throws InvalidMappingException * diff --git a/src/Tree/Strategy.php b/src/Tree/Strategy.php index 7434fe95d6..b06f5ebc4a 100644 --- a/src/Tree/Strategy.php +++ b/src/Tree/Strategy.php @@ -45,8 +45,8 @@ public function getName(); /** * Operations after metadata is loaded * - * @param ObjectManager $om - * @param ClassMetadata $meta + * @param ObjectManager $om + * @param ClassMetadata $meta * * @return void */ diff --git a/src/Tree/Strategy/AbstractMaterializedPath.php b/src/Tree/Strategy/AbstractMaterializedPath.php index 0f4cc8372f..de753fb01e 100644 --- a/src/Tree/Strategy/AbstractMaterializedPath.php +++ b/src/Tree/Strategy/AbstractMaterializedPath.php @@ -451,10 +451,10 @@ public function processPostEventsActions(ObjectManager $om, AdapterInterface $ea /** * Remove node and its children * - * @param ObjectManager $om - * @param ClassMetadata $meta Metadata - * @param array $config config - * @param object $node node to remove + * @param ObjectManager $om + * @param ClassMetadata $meta Metadata + * @param array $config config + * @param object $node node to remove * * @return void */ @@ -463,10 +463,10 @@ abstract public function removeNode($om, $meta, $config, $node); /** * Returns children of the node with its original path * - * @param ObjectManager $om - * @param ClassMetadata $meta Metadata - * @param array $config config - * @param string $originalPath original path of object + * @param ObjectManager $om + * @param ClassMetadata $meta Metadata + * @param array $config config + * @param string $originalPath original path of object * * @return array|\Traversable */ diff --git a/src/Tree/Strategy/ODM/MongoDB/MaterializedPath.php b/src/Tree/Strategy/ODM/MongoDB/MaterializedPath.php index 603736bf2d..1a5814c2e8 100644 --- a/src/Tree/Strategy/ODM/MongoDB/MaterializedPath.php +++ b/src/Tree/Strategy/ODM/MongoDB/MaterializedPath.php @@ -10,6 +10,7 @@ namespace Gedmo\Tree\Strategy\ODM\MongoDB; use Doctrine\ODM\MongoDB\DocumentManager; +use Doctrine\ODM\MongoDB\Mapping\ClassMetadata; use Doctrine\Persistence\ObjectManager; use Gedmo\Mapping\Event\AdapterInterface; use Gedmo\Tool\Wrapper\AbstractWrapper; @@ -26,7 +27,8 @@ class MaterializedPath extends AbstractMaterializedPath { /** - * @param DocumentManager $om + * @param DocumentManager $om + * @param ClassMetadata $meta */ public function removeNode($om, $meta, $config, $node) { @@ -46,7 +48,8 @@ public function removeNode($om, $meta, $config, $node) } /** - * @param DocumentManager $om + * @param DocumentManager $om + * @param ClassMetadata $meta */ public function getChildren($om, $meta, $config, $originalPath) { diff --git a/src/Tree/Strategy/ORM/Closure.php b/src/Tree/Strategy/ORM/Closure.php index 3e68f6b3d5..722c65463e 100644 --- a/src/Tree/Strategy/ORM/Closure.php +++ b/src/Tree/Strategy/ORM/Closure.php @@ -87,7 +87,8 @@ public function getName() } /** - * @param EntityManagerInterface $em + * @param EntityManagerInterface $em + * @param ORMClassMetadata $meta */ public function processMetadataLoad($em, $meta) { @@ -561,7 +562,7 @@ protected function setLevelFieldOnPendingNodes(ObjectManager $em) } /** - * @param ORMClassMetadata $closureMetadata + * @param ORMClassMetadata $closureMetadata */ private function hasClosureTableUniqueConstraint(ClassMetadata $closureMetadata): bool { @@ -579,7 +580,7 @@ private function hasClosureTableUniqueConstraint(ClassMetadata $closureMetadata) } /** - * @param ORMClassMetadata $closureMetadata + * @param ORMClassMetadata $closureMetadata */ private function hasClosureTableDepthIndex(ClassMetadata $closureMetadata): bool { diff --git a/src/Tree/Strategy/ORM/MaterializedPath.php b/src/Tree/Strategy/ORM/MaterializedPath.php index 04f16ab93e..20ecd85a47 100644 --- a/src/Tree/Strategy/ORM/MaterializedPath.php +++ b/src/Tree/Strategy/ORM/MaterializedPath.php @@ -10,6 +10,7 @@ namespace Gedmo\Tree\Strategy\ORM; use Doctrine\ORM\EntityManagerInterface; +use Doctrine\ORM\Mapping\ClassMetadata; use Gedmo\Tool\Wrapper\AbstractWrapper; use Gedmo\Tree\Strategy\AbstractMaterializedPath; @@ -25,10 +26,10 @@ class MaterializedPath extends AbstractMaterializedPath { /** * @param EntityManagerInterface $om + * @param ClassMetadata $meta */ public function removeNode($om, $meta, $config, $node) { - $uow = $om->getUnitOfWork(); $wrapped = AbstractWrapper::wrap($node, $om); $path = addcslashes($wrapped->getPropertyValue($config['path']), '%'); @@ -59,6 +60,7 @@ public function removeNode($om, $meta, $config, $node) /** * @param EntityManagerInterface $om + * @param ClassMetadata $meta */ public function getChildren($om, $meta, $config, $path) { diff --git a/src/Tree/Strategy/ORM/Nested.php b/src/Tree/Strategy/ORM/Nested.php index f74e1e5cde..cc2dca7d06 100644 --- a/src/Tree/Strategy/ORM/Nested.php +++ b/src/Tree/Strategy/ORM/Nested.php @@ -124,7 +124,7 @@ public function setNodePosition($oid, $position) public function processScheduledInsertion($em, $node, AdapterInterface $ea) { - /** @var ClassMetadata $meta */ + /** @var ClassMetadata $meta */ $meta = $em->getClassMetadata(get_class($node)); $config = $this->listener->getConfiguration($em, $meta->getName()); @@ -279,7 +279,7 @@ public function updateNode(EntityManagerInterface $em, $node, $parent, $position { $wrapped = AbstractWrapper::wrap($node, $em); - /** @var ClassMetadata $meta */ + /** @var ClassMetadata $meta */ $meta = $wrapped->getMetadata(); $config = $this->listener->getConfiguration($em, $meta->getName()); diff --git a/src/Uploadable/Mapping/Validator.php b/src/Uploadable/Mapping/Validator.php index 4dfce4c1b3..8842f17daa 100644 --- a/src/Uploadable/Mapping/Validator.php +++ b/src/Uploadable/Mapping/Validator.php @@ -95,7 +95,8 @@ class Validator public static $validateWritableDirectory = true; /** - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return void */ @@ -105,7 +106,8 @@ public static function validateFileNameField(ClassMetadata $meta, $field) } /** - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return void */ @@ -115,7 +117,8 @@ public static function validateFileMimeTypeField(ClassMetadata $meta, $field) } /** - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return void */ @@ -125,7 +128,8 @@ public static function validateFilePathField(ClassMetadata $meta, $field) } /** - * @param string $field + * @param ClassMetadata $meta + * @param string $field * * @return void */ @@ -135,10 +139,10 @@ public static function validateFileSizeField(ClassMetadata $meta, $field) } /** - * @param ClassMetadata $meta - * @param string $field - * @param string $uploadableField - * @param string[] $validFieldTypes + * @param ClassMetadata $meta + * @param string $field + * @param string $uploadableField + * @param string[] $validFieldTypes * * @return void */ @@ -182,9 +186,10 @@ public static function validatePath($path) } /** - * @param array $config + * @param ClassMetadata $meta + * @param array $config * - * @return void + * @return array * * @todo Stop receiving by reference the `$config` parameter and use `array` as return type declaration */ diff --git a/src/Uploadable/UploadableListener.php b/src/Uploadable/UploadableListener.php index 8cbfea2ad9..b97a8ef822 100644 --- a/src/Uploadable/UploadableListener.php +++ b/src/Uploadable/UploadableListener.php @@ -86,7 +86,7 @@ class UploadableListener extends MappedEventSubscriber /** * Default FileInfoInterface class * - * @phpstan-var class-string + * @var class-string */ private string $defaultFileInfoClass = FileInfoArray::class; @@ -599,7 +599,7 @@ public function setDefaultFileInfoClass($defaultFileInfoClass) /** * Returns file info default class * - * @return string + * @return class-string */ public function getDefaultFileInfoClass() { @@ -609,10 +609,8 @@ public function getDefaultFileInfoClass() /** * Adds a FileInfoInterface object for the given entity * - * @param object $entity - * @param array|FileInfoInterface|mixed $fileInfo - * - * @phpstan-assert FileInfoInterface|array $fileInfo + * @param object $entity + * @param array|FileInfoInterface $fileInfo * * @throws \RuntimeException * @@ -668,8 +666,9 @@ public function getMimeTypeGuesser() } /** - * @param array $config - * @param object $object Entity + * @param ClassMetadata $meta + * @param array $config + * @param object $object Entity * * @throws UploadableNoPathDefinedException * @@ -700,9 +699,9 @@ protected function getPath(ClassMetadata $meta, array $config, $object) } /** - * @param ClassMetadata $meta - * @param array $config - * @param object $object Entity + * @param ClassMetadata $meta + * @param array $config + * @param object $object Entity * * @return void */ @@ -734,8 +733,9 @@ protected function cancelFileRemoval($filePath) /** * Returns value of the entity's property * - * @param string $propertyName - * @param object $object + * @param ClassMetadata $meta + * @param string $propertyName + * @param object $object * * @return mixed */ @@ -749,8 +749,9 @@ protected function getPropertyValueFromObject(ClassMetadata $meta, $propertyName /** * Returns the path of the entity's file * - * @param array $config - * @param object $object + * @param ClassMetadata $meta + * @param array $config + * @param object $object * * @return string */ @@ -762,8 +763,9 @@ protected function getFilePathFieldValue(ClassMetadata $meta, array $config, $ob /** * Returns the name of the entity's file * - * @param array $config - * @param object $object + * @param ClassMetadata $meta + * @param array $config + * @param object $object * * @return string */ @@ -778,11 +780,12 @@ protected function getNamespace() } /** - * @param object $object - * @param object $uow - * @param string $field - * @param mixed $value - * @param bool $notifyPropertyChanged + * @param object $object + * @param object $uow + * @param ClassMetadata $meta + * @param string $field + * @param mixed $value + * @param bool $notifyPropertyChanged * * @return void */ diff --git a/tests/Gedmo/Blameable/BlameableTest.php b/tests/Gedmo/Blameable/BlameableTest.php index 544f35bba3..d9b226ae04 100644 --- a/tests/Gedmo/Blameable/BlameableTest.php +++ b/tests/Gedmo/Blameable/BlameableTest.php @@ -44,15 +44,11 @@ public function testBlameable(): void $sport = new Article(); $sport->setTitle('Sport'); - static::assertInstanceOf(Blameable::class, $sport); - $sportComment = new Comment(); $sportComment->setMessage('hello'); $sportComment->setArticle($sport); $sportComment->setStatus(0); - static::assertInstanceOf(Blameable::class, $sportComment); - $this->em->persist($sport); $this->em->persist($sportComment); $this->em->flush(); diff --git a/tests/Gedmo/Blameable/BlameableUuidTest.php b/tests/Gedmo/Blameable/BlameableUuidTest.php index 9ca2c0be09..9bffdcb162 100644 --- a/tests/Gedmo/Blameable/BlameableUuidTest.php +++ b/tests/Gedmo/Blameable/BlameableUuidTest.php @@ -12,7 +12,6 @@ namespace Gedmo\Tests\Blameable; use Doctrine\Common\EventManager; -use Gedmo\Blameable\Blameable; use Gedmo\Blameable\BlameableListener; use Gedmo\Tests\Blameable\Fixture\Entity\Company; use Gedmo\Tests\Tool\BaseTestCaseORM; @@ -43,8 +42,6 @@ public function testBlameableUuid(): void $company = new Company(); $company->setName('ACME'); - static::assertInstanceOf(Blameable::class, $company); - $this->em->persist($company); $this->em->flush(); $this->em->clear(); diff --git a/tests/Gedmo/IpTraceable/IpTraceableTest.php b/tests/Gedmo/IpTraceable/IpTraceableTest.php index 4b6640b897..bc454d7dcb 100644 --- a/tests/Gedmo/IpTraceable/IpTraceableTest.php +++ b/tests/Gedmo/IpTraceable/IpTraceableTest.php @@ -14,9 +14,8 @@ use Doctrine\Common\EventManager; use Doctrine\Persistence\Mapping\ClassMetadata; use Gedmo\Exception\InvalidArgumentException; -use Gedmo\IpTraceable\IpTraceable; use Gedmo\IpTraceable\IpTraceableListener; -use Gedmo\Mapping\Event\AdapterInterface; +use Gedmo\IpTraceable\Mapping\Event\IpTraceableAdapter; use Gedmo\Tests\IpTraceable\Fixture\Article; use Gedmo\Tests\IpTraceable\Fixture\Comment; use Gedmo\Tests\IpTraceable\Fixture\Type; @@ -60,7 +59,7 @@ public function testIpV4(): void static::assertSame('123.218.45.39', $listener->getFieldValue( $this->createStub(ClassMetadata::class), 'ip', - $this->createStub(AdapterInterface::class) + $this->createStub(IpTraceableAdapter::class) )); } @@ -71,7 +70,7 @@ public function testIpV6(): void static::assertSame('2001:0db8:0000:85a3:0000:0000:ac1f:8001', $listener->getFieldValue( $this->createStub(ClassMetadata::class), 'ip', - $this->createStub(AdapterInterface::class) + $this->createStub(IpTraceableAdapter::class) )); } @@ -80,15 +79,11 @@ public function testIpTraceable(): void $sport = new Article(); $sport->setTitle('Sport'); - static::assertInstanceOf(IpTraceable::class, $sport); - $sportComment = new Comment(); $sportComment->setMessage('hello'); $sportComment->setArticle($sport); $sportComment->setStatus(0); - static::assertInstanceOf(IpTraceable::class, $sportComment); - $this->em->persist($sport); $this->em->persist($sportComment); $this->em->flush(); diff --git a/tests/Gedmo/Mapping/Fixture/Attribute/TranslatableModel.php b/tests/Gedmo/Mapping/Fixture/Attribute/TranslatableModel.php index 1b9b549bc9..d864aab74d 100644 --- a/tests/Gedmo/Mapping/Fixture/Attribute/TranslatableModel.php +++ b/tests/Gedmo/Mapping/Fixture/Attribute/TranslatableModel.php @@ -18,15 +18,9 @@ class TranslatableModel #[Gedmo\Translatable] private ?string $title = null; - /** - * @var string|null - */ #[Gedmo\Translatable(fallback: true)] - private $titleFallbackTrue; + private ?string $titleFallbackTrue = null; - /** - * @var string|null - */ #[Gedmo\Translatable(fallback: false)] - private $titleFallbackFalse; + private ?string $titleFallbackFalse = null; } diff --git a/tests/Gedmo/References/ReferencesListenerTest.php b/tests/Gedmo/References/ReferencesListenerTest.php index dc218273bb..9b0d352225 100644 --- a/tests/Gedmo/References/ReferencesListenerTest.php +++ b/tests/Gedmo/References/ReferencesListenerTest.php @@ -182,7 +182,6 @@ public function testShouldPopulateReferenceManyEmbedWithLazyCollectionInstance() static::assertSame($samsungTV->getMetadatas()->first()->getCategory()->getName(), $tvMetadata->getCategory()->getName()); $tvs = $tvCategory->getProducts(); - static::assertNotNull($tvs); static::assertContainsOnlyInstancesOf(Product::class, $tvs); } } diff --git a/tests/Gedmo/Timestampable/CarbonTest.php b/tests/Gedmo/Timestampable/CarbonTest.php index d560ad0eb3..4d55c2f7ac 100644 --- a/tests/Gedmo/Timestampable/CarbonTest.php +++ b/tests/Gedmo/Timestampable/CarbonTest.php @@ -76,11 +76,9 @@ public function testShouldHandleStandardBehavior(): void /** @var ArticleCarbon $sport */ $sport = $this->em->getRepository(ArticleCarbon::class)->findOneBy(['title' => 'Sport']); - static::assertInstanceOf(CarbonImmutable::class, $sport->getUpdated(), 'Type DATETIME_MUTABLE should become CarbonImmutable'); - static::assertInstanceOf(Carbon::class, $sport->getCreated(), 'Type DATE_MUTABLE should become Carbon'); + static::assertInstanceOf(CarbonImmutable::class, $su = $sport->getUpdated(), 'Type DATETIME_MUTABLE should become CarbonImmutable'); + static::assertInstanceOf(Carbon::class, $sc = $sport->getCreated(), 'Type DATE_MUTABLE should become Carbon'); - static::assertNotNull($sc = $sport->getCreated()); - static::assertNotNull($su = $sport->getUpdated()); static::assertNull($sport->getContentChanged()); static::assertNull($sport->getPublished()); static::assertNull($sport->getAuthorChanged()); @@ -107,13 +105,9 @@ public function testShouldHandleStandardBehavior(): void $this->em->flush(); $sportComment = $this->em->getRepository(CommentCarbon::class)->findOneBy(['message' => 'hello']); - static::assertInstanceOf(CarbonImmutable::class, $sportComment->getClosed(), 'Type DATETIME_MUTABLE should become CarbonImmutable'); - static::assertInstanceOf(CarbonImmutable::class, $sport->getPublished(), 'Type DATETIME_MUTABLE should become CarbonImmutable'); - static::assertInstanceOf(CarbonImmutable::class, $sport->getAuthorChanged(), 'Type DATETIME_MUTABLE should become CarbonImmutable'); - - static::assertNotNull($scc = $sportComment->getClosed()); - static::assertNotNull($sp = $sport->getPublished()); - static::assertNotNull($sa = $sport->getAuthorChanged()); + static::assertInstanceOf(CarbonImmutable::class, $scc = $sportComment->getClosed(), 'Type DATETIME_MUTABLE should become CarbonImmutable'); + static::assertInstanceOf(CarbonImmutable::class, $sp = $sport->getPublished(), 'Type DATETIME_MUTABLE should become CarbonImmutable'); + static::assertInstanceOf(CarbonImmutable::class, $sa = $sport->getAuthorChanged(), 'Type DATETIME_MUTABLE should become CarbonImmutable'); $sport->setTitle('Updated'); $this->em->persist($sport); diff --git a/tests/Gedmo/Timestampable/ChangeTest.php b/tests/Gedmo/Timestampable/ChangeTest.php index 0d6f03bdff..192ea84a1f 100644 --- a/tests/Gedmo/Timestampable/ChangeTest.php +++ b/tests/Gedmo/Timestampable/ChangeTest.php @@ -13,6 +13,7 @@ use Doctrine\Common\EventArgs; use Doctrine\Common\EventManager; +use Doctrine\Persistence\Mapping\ClassMetadata; use Gedmo\AbstractTrackingListener; use Gedmo\Mapping\Event\Adapter\ORM as BaseAdapterORM; use Gedmo\Tests\Timestampable\Fixture\TitledArticle; @@ -122,6 +123,9 @@ public function setDateValue(\DateTime $dateTime): void $this->dateTime = $dateTime; } + /** + * @param ClassMetadata $meta + */ public function getDateValue($meta, $field): ?\DateTime { return $this->dateTime; @@ -146,7 +150,8 @@ protected function getEventAdapter(EventArgs $args) } /** - * @param EventAdapterORMStub $eventAdapter + * @param ClassMetadata $meta + * @param EventAdapterORMStub $eventAdapter */ protected function getFieldValue($meta, $field, $eventAdapter) { diff --git a/tests/Gedmo/Timestampable/Fixture/ArticleCarbon.php b/tests/Gedmo/Timestampable/Fixture/ArticleCarbon.php index 673117ff3c..56d0d2ff32 100644 --- a/tests/Gedmo/Timestampable/Fixture/ArticleCarbon.php +++ b/tests/Gedmo/Timestampable/Fixture/ArticleCarbon.php @@ -27,8 +27,6 @@ class ArticleCarbon implements Timestampable { /** - * @var int|null - * * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") @@ -36,7 +34,7 @@ class ArticleCarbon implements Timestampable #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: Types::INTEGER)] - private $id; + private ?int $id = null; /** * @ORM\Column(name="title", type="string", length=128) @@ -56,7 +54,7 @@ class ArticleCarbon implements Timestampable * @ORM\OneToMany(targetEntity="Gedmo\Tests\Timestampable\Fixture\Comment", mappedBy="article") */ #[ORM\OneToMany(targetEntity: Comment::class, mappedBy: 'article')] - private $comments; + private Collection $comments; /** * @ORM\Embedded(class="Gedmo\Tests\Timestampable\Fixture\Author") @@ -109,15 +107,13 @@ class ArticleCarbon implements Timestampable private $contentChanged; /** - * @var CarbonImmutable|null - * * @ORM\Column(name="author_changed", type="datetime", nullable=true) * * @Gedmo\Timestampable(on="change", field={"author.name", "author.email"}) */ #[ORM\Column(name: 'author_changed', type: Types::DATETIME_MUTABLE, nullable: true)] #[Gedmo\Timestampable(on: 'change', field: ['author.name', 'author.email'])] - private $authorChanged; + private ?CarbonImmutable $authorChanged = null; /** * @ORM\ManyToOne(targetEntity="Type", inversedBy="articles") @@ -134,15 +130,13 @@ class ArticleCarbon implements Timestampable /** * We use the value "10" as string here in order to check the behavior of `AbstractTrackingListener` * - * @var \DateTimeInterface|null - * * @ORM\Column(name="reached_relevant_level", type="datetime", nullable=true) * * @Gedmo\Timestampable(on="change", field="level", value="10") */ #[ORM\Column(name: 'reached_relevant_level', type: Types::DATE_MUTABLE, nullable: true)] #[Gedmo\Timestampable(on: 'change', field: 'level', value: '10')] - private $reachedRelevantLevel; + private ?\DateTimeInterface $reachedRelevantLevel = null; public function __construct() { diff --git a/tests/Gedmo/Tree/TreeTest.php b/tests/Gedmo/Tree/TreeTest.php index 82ef673012..bde7da3ee8 100644 --- a/tests/Gedmo/Tree/TreeTest.php +++ b/tests/Gedmo/Tree/TreeTest.php @@ -15,7 +15,6 @@ use Gedmo\Tests\Tool\BaseTestCaseORM; use Gedmo\Tests\Tree\Fixture\Category; use Gedmo\Tests\Tree\Fixture\CategoryUuid; -use Gedmo\Tree\Node; use Gedmo\Tree\TreeListener; /** @@ -41,7 +40,6 @@ public function testTheTree(): void $root = new Category(); $root->setTitle('Root'); - static::assertInstanceOf(Node::class, $root); $this->em->persist($root); $this->em->flush(); @@ -232,7 +230,6 @@ public function testIssue273(): void $root = new CategoryUuid(); $root->setTitle('Root'); - static::assertInstanceOf(Node::class, $root); $this->em->persist($root); $rootId = $root->getId(); diff --git a/tests/Gedmo/Uploadable/Mapping/ValidatorTest.php b/tests/Gedmo/Uploadable/Mapping/ValidatorTest.php index 2e6a7132cb..b6de1b07dd 100644 --- a/tests/Gedmo/Uploadable/Mapping/ValidatorTest.php +++ b/tests/Gedmo/Uploadable/Mapping/ValidatorTest.php @@ -29,7 +29,7 @@ final class ValidatorTest extends TestCase { /** - * @var ClassMetadata&MockObject + * @var ClassMetadata&MockObject */ protected $meta; diff --git a/tests/Gedmo/Uploadable/UploadableEntityTest.php b/tests/Gedmo/Uploadable/UploadableEntityTest.php index d37761d1e3..0b496238b6 100644 --- a/tests/Gedmo/Uploadable/UploadableEntityTest.php +++ b/tests/Gedmo/Uploadable/UploadableEntityTest.php @@ -569,6 +569,8 @@ public function testMoveFileIfUploadedFileCantBeMovedThrowException(): void public function testAddEntityFileInfoIfFileInfoIsNotValidThrowException(): void { $this->expectException('RuntimeException'); + + /** @phpstan-ignore-next-line argument.type */ $this->listener->addEntityFileInfo(new Image(), 'invalidFileInfo'); } @@ -712,7 +714,7 @@ public function testUseGeneratedFilenameWhenAppendingNumbers(): void // Data Providers /** - * @return array> + * @return list */ public static function invalidFileInfoClassesProvider(): array { @@ -727,9 +729,9 @@ public static function invalidFileInfoClassesProvider(): array } /** - * @return array> + * @return list * - * @phpstan-return array>> + * @phpstan-return list}> */ public static function uploadExceptionsProvider(): array {