Release 2.23.0 (#5075)
This commit is contained in:
@@ -17,12 +17,11 @@ final class DateTimeFormatValidator extends ConstraintValidator
|
||||
{
|
||||
/**
|
||||
* @param string|mixed|null $value
|
||||
* @param Constraint $constraint
|
||||
*/
|
||||
public function validate(mixed $value, Constraint $constraint): void
|
||||
{
|
||||
if (!($constraint instanceof DateTimeFormat)) {
|
||||
throw new UnexpectedTypeException($constraint, __NAMESPACE__ . '\DateTimeFormat');
|
||||
throw new UnexpectedTypeException($constraint, DateTimeFormat::class);
|
||||
}
|
||||
|
||||
if (!\is_string($value)) {
|
||||
|
||||
@@ -18,7 +18,7 @@ final class HexColorValidator extends ConstraintValidator
|
||||
public function validate(mixed $value, Constraint $constraint): void
|
||||
{
|
||||
if (!$constraint instanceof HexColor) {
|
||||
throw new UnexpectedTypeException($constraint, __NAMESPACE__ . '\HexColor');
|
||||
throw new UnexpectedTypeException($constraint, HexColor::class);
|
||||
}
|
||||
|
||||
$color = $value;
|
||||
|
||||
@@ -16,14 +16,14 @@ use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
||||
|
||||
final class RoleValidator extends ConstraintValidator
|
||||
{
|
||||
public function __construct(private RoleService $service)
|
||||
public function __construct(private readonly RoleService $service)
|
||||
{
|
||||
}
|
||||
|
||||
public function validate(mixed $value, Constraint $constraint): void
|
||||
{
|
||||
if (!$constraint instanceof Role) {
|
||||
throw new UnexpectedTypeException($constraint, __NAMESPACE__ . '\Role');
|
||||
throw new UnexpectedTypeException($constraint, Role::class);
|
||||
}
|
||||
|
||||
$roles = $value;
|
||||
|
||||
@@ -18,12 +18,11 @@ final class TimeFormatValidator extends ConstraintValidator
|
||||
{
|
||||
/**
|
||||
* @param string|mixed $value
|
||||
* @param Constraint $constraint
|
||||
*/
|
||||
public function validate(mixed $value, Constraint $constraint): void
|
||||
{
|
||||
if (!($constraint instanceof TimeFormat)) {
|
||||
throw new UnexpectedTypeException($constraint, __NAMESPACE__ . '\TimeFormat');
|
||||
throw new UnexpectedTypeException($constraint, TimeFormat::class);
|
||||
}
|
||||
|
||||
if (null === $value || '' === $value) {
|
||||
|
||||
@@ -20,12 +20,11 @@ final class TimesheetMultiUpdateValidator extends ConstraintValidator
|
||||
{
|
||||
/**
|
||||
* @param TimesheetMultiUpdateDTO|mixed $value
|
||||
* @param Constraint $constraint
|
||||
*/
|
||||
public function validate(mixed $value, Constraint $constraint): void
|
||||
{
|
||||
if (!($constraint instanceof TimesheetMultiUpdateConstraint)) {
|
||||
throw new UnexpectedTypeException($constraint, __NAMESPACE__ . '\TimesheetMultiUpdate');
|
||||
throw new UnexpectedTypeException($constraint, TimesheetMultiUpdateConstraint::class);
|
||||
}
|
||||
|
||||
if (!\is_object($value) || !($value instanceof TimesheetMultiUpdateDTO)) {
|
||||
@@ -49,10 +48,6 @@ final class TimesheetMultiUpdateValidator extends ConstraintValidator
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TimesheetMultiUpdateDTO $dto
|
||||
* @param ExecutionContextInterface $context
|
||||
*/
|
||||
protected function validateActivityAndProject(TimesheetMultiUpdateDTO $dto, ExecutionContextInterface $context): void
|
||||
{
|
||||
$activity = $dto->getActivity();
|
||||
|
||||
Reference in New Issue
Block a user