| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 63 | public function time($time) |
||
| 64 | { |
||
| 65 | if ($time instanceof DateTimeInterface) { |
||
| 66 | return $this->time($time->getTimestamp()); |
||
| 67 | } |
||
| 68 | |||
| 69 | if (is_numeric($time)) { |
||
| 70 | $this->time = Carbon::createFromTimestamp($time); |
||
| 71 | |||
| 72 | return $this; |
||
| 73 | } |
||
| 74 | |||
| 75 | throw CouldNotSendNotification::withErrorMessage( |
||
| 76 | sprintf('Time must be a timestamp or an object implementing DateTimeInterface. %s is given', gettype($time)) |
||
| 77 | ); |
||
| 78 | } |
||
| 79 | |||
| 104 |