Applied symplify rules to codebase.

This commit is contained in:
Jan Böhmer 2020-01-05 22:49:00 +01:00
parent 2f20d90041
commit 388e847b17
136 changed files with 1370 additions and 789 deletions

View file

@ -32,6 +32,7 @@ use Doctrine\ORM\Event\LifecycleEventArgs;
use Doctrine\ORM\Event\PreUpdateEventArgs;
use Doctrine\ORM\Mapping\PostRemove;
use Doctrine\ORM\Mapping\PreUpdate;
use SplFileInfo;
/**
* This listener watches for changes on attachments and deletes the files associated with an attachment, that are not
@ -63,7 +64,7 @@ class AttachmentDeleteListener
return;
}
$file = new \SplFileInfo($this->pathResolver->placeholderToRealPath($event->getOldValue('path')));
$file = new SplFileInfo($this->pathResolver->placeholderToRealPath($event->getOldValue('path')));
$this->attachmentReverseSearch->deleteIfNotUsed($file);
}
}

View file

@ -31,6 +31,7 @@ use App\Entity\UserSystem\User;
use App\Services\UserCacheKeyGenerator;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Doctrine\ORM\Mapping as ORM;
use function get_class;
use Symfony\Contracts\Cache\TagAwareCacheInterface;
class TreeCacheInvalidationListener
@ -53,7 +54,7 @@ class TreeCacheInvalidationListener
{
//If an element was changed, then invalidate all cached trees with this element class
if ($element instanceof StructuralDBElement) {
$secure_class_name = str_replace('\\', '_', \get_class($element));
$secure_class_name = str_replace('\\', '_', get_class($element));
$this->cache->invalidateTags([$secure_class_name]);
}