mirror of
https://github.com/MarijnDoeve/TijdVoorDeTest.git
synced 2026-03-06 12:44:20 +01:00
Add AbstractController, implement flash message handling, and refactor repositories
This commit is contained in:
19
src/Controller/AbstractController.php
Normal file
19
src/Controller/AbstractController.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Enum\FlashType;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController as AbstractBaseController;
|
||||
|
||||
abstract class AbstractController extends AbstractBaseController
|
||||
{
|
||||
protected function addFlash(FlashType|string $type, mixed $message): void
|
||||
{
|
||||
if ($type instanceof FlashType) {
|
||||
$type = $type->value;
|
||||
}
|
||||
parent::addFlash($type, $message);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user