Next major version 2 with PHP 8.1, Symfony 6, Tabler UI, 2FA ... (#2902)
This commit is contained in:
@@ -9,14 +9,10 @@
|
||||
|
||||
namespace App\Validator\Constraints;
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation\Target;
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
|
||||
/**
|
||||
* @Annotation
|
||||
* @Target({"CLASS", "PROPERTY", "METHOD", "ANNOTATION"})
|
||||
*/
|
||||
class User extends Constraint
|
||||
#[\Attribute(\Attribute::TARGET_CLASS)]
|
||||
final class User extends Constraint
|
||||
{
|
||||
public const USER_EXISTING_EMAIL = 'kimai-user-00';
|
||||
public const USER_EXISTING_NAME = 'kimai-user-01';
|
||||
@@ -30,9 +26,9 @@ class User extends Constraint
|
||||
self::USER_EXISTING_NAME_AS_EMAIL => 'An equal email is already used.',
|
||||
];
|
||||
|
||||
public $message = 'The user has invalid settings.';
|
||||
public string $message = 'The user has invalid settings.';
|
||||
|
||||
public function getTargets()
|
||||
public function getTargets(): string|array
|
||||
{
|
||||
return self::CLASS_CONSTRAINT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user