1<?php 2 3declare(strict_types=1); 4 5namespace JMS\Serializer\Tests\Fixtures; 6 7use JMS\Serializer\Annotation\Type; 8 9class DateTimeArraysObject 10{ 11 /** 12 * @var \DateTime[] 13 * @Type("array<DateTime>") 14 */ 15 private $arrayWithDefaultDateTime; 16 17 /** 18 * @var \DateTime[] 19 * @Type("array<DateTime<'d.m.Y H:i:s'>>") 20 */ 21 private $arrayWithFormattedDateTime; 22 23 public function __construct($arrayWithDefaultDateTime, $arrayWithFormattedDateTime) 24 { 25 $this->arrayWithDefaultDateTime = $arrayWithDefaultDateTime; 26 $this->arrayWithFormattedDateTime = $arrayWithFormattedDateTime; 27 } 28 29 /** 30 * @return \DateTime[] 31 */ 32 public function getArrayWithDefaultDateTime() 33 { 34 return $this->arrayWithDefaultDateTime; 35 } 36 37 /** 38 * @return \DateTime[] 39 */ 40 public function getArrayWithFormattedDateTime() 41 { 42 return $this->arrayWithFormattedDateTime; 43 } 44} 45