Mercurial > hg > isophonics-drupal-site
comparison vendor/zendframework/zend-feed/src/Writer/Deleted.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 7a779792577d |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
8 */ | 8 */ |
9 | 9 |
10 namespace Zend\Feed\Writer; | 10 namespace Zend\Feed\Writer; |
11 | 11 |
12 use DateTime; | 12 use DateTime; |
13 use DateTimeInterface; | |
13 use Zend\Feed\Uri; | 14 use Zend\Feed\Uri; |
14 | 15 |
15 /** | 16 /** |
16 */ | 17 */ |
17 class Deleted | 18 class Deleted |
130 } | 131 } |
131 | 132 |
132 /** | 133 /** |
133 * Set when | 134 * Set when |
134 * | 135 * |
135 * @param null|string|DateTime $date | 136 * @param null|int|DateTimeInterface $date |
136 * @throws Exception\InvalidArgumentException | 137 * @throws Exception\InvalidArgumentException |
137 * @return Deleted | 138 * @return Deleted |
138 */ | 139 */ |
139 public function setWhen($date = null) | 140 public function setWhen($date = null) |
140 { | 141 { |
141 if ($date === null) { | 142 if ($date === null) { |
142 $date = new DateTime(); | 143 $date = new DateTime(); |
143 } elseif (is_int($date)) { | 144 } |
145 if (is_int($date)) { | |
144 $date = new DateTime('@' . $date); | 146 $date = new DateTime('@' . $date); |
145 } elseif (! $date instanceof DateTime) { | 147 } |
148 if (! $date instanceof DateTimeInterface) { | |
146 throw new Exception\InvalidArgumentException('Invalid DateTime object or UNIX Timestamp' | 149 throw new Exception\InvalidArgumentException('Invalid DateTime object or UNIX Timestamp' |
147 . ' passed as parameter'); | 150 . ' passed as parameter'); |
148 } | 151 } |
149 $this->data['when'] = $date; | 152 $this->data['when'] = $date; |
150 | 153 |