mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-04 23:44:33 +02:00
Applied symplify rules to codebase.
This commit is contained in:
parent
2f20d90041
commit
388e847b17
136 changed files with 1370 additions and 789 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue