Started to move doctrine annotations to attributes (rector automated)

This commit is contained in:
Jan Böhmer 2023-05-28 01:33:45 +02:00
parent bb1285c35c
commit 0bc4699cdc
73 changed files with 483 additions and 604 deletions

View file

@ -54,9 +54,8 @@ class AttachmentDeleteListener
/**
* Removes the file associated with the attachment, if the file associated with the attachment changes.
*
* @PreUpdate
*/
#[PreUpdate]
public function preUpdateHandler(Attachment $attachment, PreUpdateEventArgs $event): void
{
if ($event->hasChangedField('path')) {
@ -81,9 +80,8 @@ class AttachmentDeleteListener
/**
* Ensure that attachments are not used in preview, so that they can be deleted (without integrity violation).
*
* @ORM\PreRemove()
*/
#[ORM\PreRemove]
public function preRemoveHandler(Attachment $attachment, PreRemoveEventArgs $event): void
{
//Ensure that the attachment that will be deleted, is not used as preview picture anymore...
@ -109,9 +107,8 @@ class AttachmentDeleteListener
/**
* Removes the file associated with the attachment, after the attachment was deleted.
*
* @PostRemove
*/
#[PostRemove]
public function postRemoveHandler(Attachment $attachment, PostRemoveEventArgs $event): void
{
//Dont delete file if the attachment uses a builtin ressource:

View file

@ -44,11 +44,9 @@ class TreeCacheInvalidationListener
$this->keyGenerator = $keyGenerator;
}
/**
* @ORM\PostUpdate()
* @ORM\PostPersist()
* @ORM\PostRemove()
*/
#[ORM\PostUpdate]
#[ORM\PostPersist]
#[ORM\PostRemove]
public function invalidate(AbstractDBElement $element, LifecycleEventArgs $event): void
{
//If an element was changed, then invalidate all cached trees with this element class