feat: further decouple logic using events

This commit is contained in:
Björn Fromme
2024-07-18 12:42:02 +02:00
parent 3a77697d9d
commit a1882a4af1
10 changed files with 127 additions and 68 deletions
@@ -5,7 +5,6 @@ namespace App\Controller\Admin\Application;
use App\Entity\Application;
use App\Event\ApplicationDeletedEvent;
use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
@@ -16,8 +15,7 @@ class DeleteController extends AbstractController
{
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly EventDispatcherInterface $eventDispatcher,
private readonly LoggerInterface $logger
private readonly EventDispatcherInterface $eventDispatcher
) {
}
@@ -36,11 +34,6 @@ class DeleteController extends AbstractController
$this->addFlash('success', 'Die Bewerbung wurde gelöscht');
$this->logger->info('Delete application', [
'destination' => (string) $application->getAssignment()->getDestination(),
'teamer' => (string) $application->getTeamer(),
]);
return $this->redirectToRoute('app_administrative_assignment_detail', [
'uuid' => $application->getAssignment()->getUuid(),
]);