| @@ 37-50 (lines=14) @@ | ||
| 34 | * |
|
| 35 | * @return SendResponse |
|
| 36 | */ |
|
| 37 | public static function create(array $data) |
|
| 38 | { |
|
| 39 | $id = ''; |
|
| 40 | $message = ''; |
|
| 41 | ||
| 42 | if (isset($data['id'])) { |
|
| 43 | $id = $data['id']; |
|
| 44 | } |
|
| 45 | if (isset($data['message'])) { |
|
| 46 | $message = $data['message']; |
|
| 47 | } |
|
| 48 | ||
| 49 | return new self($id, $message); |
|
| 50 | } |
|
| 51 | ||
| 52 | /** |
|
| 53 | * @return string |
|
| @@ 46-59 (lines=14) @@ | ||
| 43 | * |
|
| 44 | * @return static |
|
| 45 | */ |
|
| 46 | public static function create(array $data) |
|
| 47 | { |
|
| 48 | $webhook = []; |
|
| 49 | $message = ''; |
|
| 50 | if (isset($data['webhook'])) { |
|
| 51 | $webhook = $data['webhook']; |
|
| 52 | } |
|
| 53 | ||
| 54 | if (isset($data['message'])) { |
|
| 55 | $message = $data['message']; |
|
| 56 | } |
|
| 57 | ||
| 58 | return new static($webhook, $message); |
|
| 59 | } |
|
| 60 | ||
| 61 | /** |
|
| 62 | * @return string|null |
|