M0: Skelett + Auth-Grundgerüst (Keycloak-OIDC + API-Token)
- Symfony 7.4 LTS, PHP 8.4, FrankenPHP, SQLite (3-Layer src/UI|Logic|Data) - Auth: manueller OidcClient (Authorization-Code) im UI-Layer, kein Security-Bundle/league; Session-Gate via SessionAuthSubscriber - API-Guard via statischem X-Api-Token (ApiTokenSubscriber); ExceptionSubscriber - UserEntity (Auto-Provision) + Init-Migration - Docker (php:8.4-frankenphp) + compose (essen.ljh31.de, traefik-net external) - SmokeTests (7) grün: Redirect-Fälle, API-Token, Auth-Render, Logout Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Logic\Common\Exception;
|
||||
|
||||
final class ValidationException extends DomainException
|
||||
{
|
||||
/**
|
||||
* @var array<string, list<string>> Feld → Liste von Fehlermeldungen
|
||||
*/
|
||||
public function __construct(
|
||||
private readonly array $errors = [],
|
||||
) {
|
||||
parent::__construct('Validierungsfehler.');
|
||||
}
|
||||
|
||||
/** @param array<string, list<string>> $errors */
|
||||
public static function fieldErrors(array $errors): self
|
||||
{
|
||||
return new self($errors);
|
||||
}
|
||||
|
||||
/** @return array<string, list<string>> */
|
||||
public function getErrors(): array
|
||||
{
|
||||
return $this->errors;
|
||||
}
|
||||
|
||||
public function getHttpStatusCode(): int
|
||||
{
|
||||
return 422;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user