mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-08 01:14:34 +02:00
Applied rector with PHP8.1 migration rules
This commit is contained in:
parent
dc6a67c2f0
commit
7ee01d9a05
303 changed files with 1228 additions and 3465 deletions
|
@ -40,21 +40,12 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||
|
||||
class LogTargetHelper
|
||||
{
|
||||
protected EntityManagerInterface $em;
|
||||
protected LogEntryRepository $entryRepository;
|
||||
protected EntityURLGenerator $entityURLGenerator;
|
||||
protected ElementTypeNameGenerator $elementTypeNameGenerator;
|
||||
protected TranslatorInterface $translator;
|
||||
|
||||
public function __construct(EntityManagerInterface $entityManager, EntityURLGenerator $entityURLGenerator,
|
||||
ElementTypeNameGenerator $elementTypeNameGenerator, TranslatorInterface $translator)
|
||||
public function __construct(protected EntityManagerInterface $em, protected EntityURLGenerator $entityURLGenerator,
|
||||
protected ElementTypeNameGenerator $elementTypeNameGenerator, protected TranslatorInterface $translator)
|
||||
{
|
||||
$this->em = $entityManager;
|
||||
$this->entryRepository = $entityManager->getRepository(AbstractLogEntry::class);
|
||||
|
||||
$this->entityURLGenerator = $entityURLGenerator;
|
||||
$this->elementTypeNameGenerator = $elementTypeNameGenerator;
|
||||
$this->translator = $translator;
|
||||
$this->entryRepository = $em->getRepository(AbstractLogEntry::class);
|
||||
}
|
||||
|
||||
private function configureOptions(OptionsResolver $resolver): self
|
||||
|
@ -79,7 +70,7 @@ class LogTargetHelper
|
|||
$target = $this->entryRepository->getTargetElement($context);
|
||||
|
||||
//If the target is null and the context has a target, that means that the target was deleted. Show it that way.
|
||||
if ($target === null) {
|
||||
if (!$target instanceof \App\Entity\Base\AbstractDBElement) {
|
||||
if ($context->hasTarget()) {
|
||||
return $this->elementTypeNameGenerator->formatElementDeletedHTML($context->getTargetClass(),
|
||||
$context->getTargetId());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue