diff --git a/config/sets/doctrine-mongodb-annotations-to-attributes.php b/config/sets/doctrine-mongodb-annotations-to-attributes.php new file mode 100644 index 00000000..f881065b --- /dev/null +++ b/config/sets/doctrine-mongodb-annotations-to-attributes.php @@ -0,0 +1,59 @@ +ruleWithConfiguration(NestedAnnotationToAttributeRector::class, [ + new NestedAnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\Indexes', [ + new AnnotationPropertyToAttributeClass('Doctrine\ODM\MongoDB\Mapping\Annotations\Index'), + new AnnotationPropertyToAttributeClass('Doctrine\ODM\MongoDB\Mapping\Annotations\UniqueIndex'), + ], true), + ]); + $rectorConfig->ruleWithConfiguration(AnnotationToAttributeRector::class, [ + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\File\ChunkSize'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\File\Filename'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\File\Length'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\File\Metadata'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\File\UploadDate'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\AlsoLoad'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\ChangeTrackingPolicy'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\DefaultDiscriminatorValue'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\DiscriminatorField'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\DiscriminatorMap'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\DiscriminatorValue'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\Document'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\EmbeddedDocument'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\EmbedMany'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\EmbedOne'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\Field'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\File'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\HasLifecycleCallbacks'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\Id'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\Index'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\InheritanceType'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\Lock'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\MappedSuperclass'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\PostLoad'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\PostPersist'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\PostRemove'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\PostUpdate'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\PreFlush'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\PreLoad'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\PrePersist'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\PreRemove'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\PreUpdate'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\QueryResultDocument'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\ReadPreference'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\ReferenceMany'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\ReferenceOne'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\ShardKey'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\UniqueIndex'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\Validation'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\Version'), + new AnnotationToAttribute('Doctrine\ODM\MongoDB\Mapping\Annotations\View'), + ]); +}; diff --git a/src/Set/DoctrineSetList.php b/src/Set/DoctrineSetList.php index a479be60..4064b810 100644 --- a/src/Set/DoctrineSetList.php +++ b/src/Set/DoctrineSetList.php @@ -88,4 +88,9 @@ final class DoctrineSetList implements SetListInterface * @var string */ public const GEDMO_ANNOTATIONS_TO_ATTRIBUTES = __DIR__ . '/../../config/sets/doctrine-gedmo-annotations-to-attributes.php'; + + /** + * @var string + */ + public const MONGODB__ANNOTATIONS_TO_ATTRIBUTES = __DIR__ . '/../../config/sets/doctrine-mongodb-annotations-to-attributes.php'; }