fix task for symfony 5.4

This commit is contained in:
Julien Fastré 2024-04-10 16:08:35 +02:00
parent 680513a3a6
commit 38e5d9c7cc
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
2 changed files with 0 additions and 3 deletions

View File

@ -55,7 +55,6 @@ class DateIntervalType extends AbstractType
{ {
$builder $builder
->add('n', IntegerType::class, [ ->add('n', IntegerType::class, [
'scale' => 0,
'constraints' => [ 'constraints' => [
new GreaterThan([ new GreaterThan([
'value' => 0, 'value' => 0,

View File

@ -29,7 +29,6 @@ use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Index(name: 'by_end_date', columns: ['end_date'])] #[ORM\Index(name: 'by_end_date', columns: ['end_date'])]
class SingleTask extends AbstractTask class SingleTask extends AbstractTask
{ {
#[Assert\Date]
#[Serializer\Groups(['read'])] #[Serializer\Groups(['read'])]
#[ORM\Column(name: 'end_date', type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE, nullable: true)] #[ORM\Column(name: 'end_date', type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE, nullable: true)]
private ?\DateTime $endDate = null; private ?\DateTime $endDate = null;
@ -44,7 +43,6 @@ class SingleTask extends AbstractTask
private ?RecurringTask $recurringTask = null; private ?RecurringTask $recurringTask = null;
#[Serializer\Groups(['read'])] #[Serializer\Groups(['read'])]
#[Assert\Date]
#[Assert\Expression('value === null or this.getEndDate() === null or value < this.getEndDate()', message: 'The start date must be before the end date')] #[Assert\Expression('value === null or this.getEndDate() === null or value < this.getEndDate()', message: 'The start date must be before the end date')]
#[Assert\Expression('value === null or this.getWarningDate() === null or this.getWarningDate() > this.getStartDate()', message: 'The start date must be before warning date')] #[Assert\Expression('value === null or this.getWarningDate() === null or this.getWarningDate() > this.getStartDate()', message: 'The start date must be before warning date')]
#[ORM\Column(name: 'start_date', type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE, nullable: true)] #[ORM\Column(name: 'start_date', type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE, nullable: true)]