@@ 177-187 (lines=11) @@ | ||
174 | * @returns $this |
|
175 | * @throws InvalidArgumentException If an argument is invalid. |
|
176 | */ |
|
177 | public function setTimestamp( $timestamp ) { |
|
178 | if ( ! $timestamp instanceof DateTime ) { |
|
179 | try { |
|
180 | $timestamp = new DateTime( $timestamp ); |
|
181 | } catch ( \Exception $ex ) { |
|
182 | throw new InvalidArgumentException( __METHOD__ . ': Invalid timestamp', 0, $ex ); |
|
183 | } |
|
184 | } |
|
185 | $this->timestamp = $timestamp; |
|
186 | return $this; |
|
187 | } |
|
188 | ||
189 | /** |
|
190 | * Compare timestamps. |
@@ 156-166 (lines=11) @@ | ||
153 | * @returns $this |
|
154 | * @throws InvalidArgumentException If an argument is invalid. |
|
155 | */ |
|
156 | public function setTimestamp( $timestamp ) { |
|
157 | if ( null !== $timestamp && ! $timestamp instanceof DateTime ) { |
|
158 | try { |
|
159 | $timestamp = new DateTime( $timestamp ); |
|
160 | } catch ( \Exception $ex ) { |
|
161 | throw new InvalidArgumentException( __METHOD__ . ': Invalid timestamp', 0, $ex ); |
|
162 | } |
|
163 | } |
|
164 | $this->timestamp = $timestamp; |
|
165 | return $this; |
|
166 | } |
|
167 | ||
168 | /** |
|
169 | * Get the prologue content. |