Trim PersonIdentifier values during denormalization, implement RequiredIdentifierConstraint and validator, and add tests for empty value validation.

This commit is contained in:
2025-09-18 14:01:34 +02:00
parent 4207efd6bf
commit 52404956d2
4 changed files with 216 additions and 2 deletions

View File

@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\PersonBundle\PersonIdentifier\Validator;
use Symfony\Component\Validator\Constraint;
/**
* Test that the required constraints are present.
*/
class RequiredIdentifierConstraint extends Constraint
{
public string $message = 'This identifier must be set';
public function getTargets(): string
{
return self::PROPERTY_CONSTRAINT;
}
}