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