| Conditions | 5 |
| Paths | 6 |
| Total Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 58 | public function setTs($ts) |
||
| 59 | { |
||
| 60 | if ($ts === null) { |
||
| 61 | $this->ts = null; |
||
| 62 | return $this; |
||
| 63 | } |
||
| 64 | |||
| 65 | if (is_string($ts)) { |
||
| 66 | try { |
||
| 67 | $ts = new DateTime($ts); |
||
| 68 | } catch (Exception $e) { |
||
| 69 | throw new InvalidArgumentException($e->getMessage()); |
||
| 70 | } |
||
| 71 | } |
||
| 72 | |||
| 73 | if (!($ts instanceof DateTimeInterface)) { |
||
| 74 | throw new InvalidArgumentException( |
||
| 75 | 'Invalid "Send Date" value. Must be a date/time string or a DateTime object.' |
||
| 76 | ); |
||
| 77 | } |
||
| 78 | |||
| 79 | $this->ts = $ts; |
||
| 80 | return $this; |
||
| 81 | } |
||
| 82 | |||
| 109 |