]> Raphaël G. Git Repositories - airbundle/commitdiff
Replace deprecated datetime by datetime_immutable in period
authorRaphaël Gertz <git@rapsys.eu>
Sat, 5 Dec 2026 03:23:30 +0000 (04:23 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Sat, 5 Dec 2026 03:23:30 +0000 (04:23 +0100)
Controller/AbstractController.php

index 423d2fdb7806403f221312cf177ff1d8ef93f623..9f72c5f5c173bb521154081fd623928cdb6cbd5a 100644 (file)
@@ -122,12 +122,12 @@ abstract class AbstractController extends BaseAbstractController implements Serv
                //Set period
                $this->period = new \DatePeriod(
                        //Start from first monday of week
                //Set period
                $this->period = new \DatePeriod(
                        //Start from first monday of week
-                       new \DateTime('Monday this week'),
+                       new \DateTimeImmutable('Monday this week'),
                        //Iterate on each day
                        new \DateInterval('P1D'),
                        //End with next sunday and 4 weeks
                        //XXX: we can't use isGranted here as AuthenticatedVoter deny access because user is likely not authenticated yet :'(
                        //Iterate on each day
                        new \DateInterval('P1D'),
                        //End with next sunday and 4 weeks
                        //XXX: we can't use isGranted here as AuthenticatedVoter deny access because user is likely not authenticated yet :'(
-                       new \DateTime('Monday this week + 2 week')
+                       new \DateTimeImmutable('Monday this week + 2 week')
                );
 
                //Get main request
                );
 
                //Get main request