]> Raphaël G. Git Repositories - airbundle/commitdiff
Set synchronized as not nullable
authorRaphaël Gertz <git@rapsys.eu>
Tue, 27 Feb 2024 15:31:02 +0000 (16:31 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Tue, 27 Feb 2024 15:31:02 +0000 (16:31 +0100)
Entity/GoogleCalendar.php

index 70a11749dc4da1f8ac346b1d23244039e3e43e7c..940a678b01fa8e3a45a11948853863c8d3adeb56 100644 (file)
@@ -37,7 +37,7 @@ class GoogleCalendar {
        /**
         * @var \DateTime
         */
        /**
         * @var \DateTime
         */
-       private ?\DateTime $synchronized;
+       private \DateTime $synchronized;
 
        /**
         * @var \DateTime
 
        /**
         * @var \DateTime
@@ -60,9 +60,9 @@ class GoogleCalendar {
         * @param \Rapsys\AirBundle\Entity\GoogleToken $googleToken The google token
         * @param string $mail The google calendar id
         * @param string $summary The google calendar summary
         * @param \Rapsys\AirBundle\Entity\GoogleToken $googleToken The google token
         * @param string $mail The google calendar id
         * @param string $summary The google calendar summary
-        * @param ?\DateTime $synchronized The google calendar last synchronization
+        * @param \DateTime $synchronized The google calendar last synchronization
         */
         */
-       public function __construct(GoogleToken $googleToken, string $mail, string $summary, ?\DateTime $synchronized = null) {
+       public function __construct(GoogleToken $googleToken, string $mail, string $summary, \DateTime $synchronized = new \DateTime('now')) {
                //Set defaults
                $this->googleToken = $googleToken;
                $this->mail = $mail;
                //Set defaults
                $this->googleToken = $googleToken;
                $this->mail = $mail;
@@ -126,11 +126,11 @@ class GoogleCalendar {
        /**
         * Set synchronized
         *
        /**
         * Set synchronized
         *
-        * @param ?\DateTime $synchronized
+        * @param \DateTime $synchronized
         *
         * @return GoogleCalendar
         */
         *
         * @return GoogleCalendar
         */
-       public function setSynchronized(?\DateTime $synchronized = null): GoogleCalendar {
+       public function setSynchronized(\DateTime $synchronized): GoogleCalendar {
                $this->synchronized = $synchronized;
 
                return $this;
                $this->synchronized = $synchronized;
 
                return $this;
@@ -139,9 +139,9 @@ class GoogleCalendar {
        /**
         * Get synchronized
         *
        /**
         * Get synchronized
         *
-        * @return ?\DateTime
+        * @return \DateTime
         */
         */
-       public function getSynchronized(): ?\DateTime {
+       public function getSynchronized(): \DateTime {
                return $this->synchronized;
        }
 
                return $this->synchronized;
        }