@@ -203,11 +203,11 @@ public function driverUnwrapData(array $wrapper): mixed
203203
204204 /**
205205 * @param array $wrapper
206- * @return DateTime
206+ * @return DateTimeInterface
207207 */
208- public function driverUnwrapEdate (array $ wrapper ): \DateTime
208+ public function driverUnwrapEdate (array $ wrapper ): \DateTimeInterface
209209 {
210- if ($ wrapper [self ::DRIVER_EDATE_WRAPPER_INDEX ] instanceof \DateTime ) {
210+ if ($ wrapper [self ::DRIVER_EDATE_WRAPPER_INDEX ] instanceof \DateTimeInterface ) {
211211 return $ wrapper [self ::DRIVER_EDATE_WRAPPER_INDEX ];
212212 }
213213
@@ -216,11 +216,11 @@ public function driverUnwrapEdate(array $wrapper): \DateTime
216216
217217 /**
218218 * @param array $wrapper
219- * @return DateTime |null
219+ * @return DateTimeInterface |null
220220 */
221- public function driverUnwrapCdate (array $ wrapper ): ?\DateTime
221+ public function driverUnwrapCdate (array $ wrapper ): ?\DateTimeInterface
222222 {
223- if ($ wrapper [self ::DRIVER_CDATE_WRAPPER_INDEX ] instanceof \DateTime ) {
223+ if ($ wrapper [self ::DRIVER_CDATE_WRAPPER_INDEX ] instanceof \DateTimeInterface ) {
224224 return $ wrapper [self ::DRIVER_CDATE_WRAPPER_INDEX ];
225225 }
226226
@@ -229,11 +229,11 @@ public function driverUnwrapCdate(array $wrapper): ?\DateTime
229229
230230 /**
231231 * @param array $wrapper
232- * @return DateTime |null
232+ * @return DateTimeInterface |null
233233 */
234- public function driverUnwrapMdate (array $ wrapper ): ?\DateTime
234+ public function driverUnwrapMdate (array $ wrapper ): ?\DateTimeInterface
235235 {
236- if ($ wrapper [self ::DRIVER_MDATE_WRAPPER_INDEX ] instanceof \DateTime ) {
236+ if ($ wrapper [self ::DRIVER_MDATE_WRAPPER_INDEX ] instanceof \DateTimeInterface ) {
237237 return $ wrapper [self ::DRIVER_MDATE_WRAPPER_INDEX ];
238238 }
239239
@@ -269,6 +269,6 @@ protected function encode($data): string
269269 */
270270 protected function decode (?string $ value ): mixed
271271 {
272- return \unserialize (( string ) $ value , ['allowed_classes ' => true ]);
272+ return $ value ? \unserialize ($ value , ['allowed_classes ' => true ]) : null ;
273273 }
274274}
0 commit comments