| 1 | <?php |
||
| 5 | class GitterMessage |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Gitter room id. |
||
| 9 | * |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | public $room = ''; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * A user or app access token. |
||
| 16 | * |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | public $from = ''; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * The text content of the message. |
||
| 23 | * |
||
| 24 | * @var string |
||
| 25 | */ |
||
| 26 | public $content = ''; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Create a new instance of GitterMessage. |
||
| 30 | * |
||
| 31 | * @param string $content |
||
| 32 | * |
||
| 33 | * @return static |
||
| 34 | */ |
||
| 35 | 4 | public static function create($content = '') |
|
| 39 | |||
| 40 | /** |
||
| 41 | * Create a new instance of GitterMessage. |
||
| 42 | * |
||
| 43 | * @param string $content |
||
| 44 | */ |
||
| 45 | 8 | public function __construct(string $content = '') |
|
| 49 | |||
| 50 | /** |
||
| 51 | * Set the Gitter room id to send message to. |
||
| 52 | * |
||
| 53 | * @param string $roomId |
||
| 54 | * |
||
| 55 | * @return $this |
||
| 56 | */ |
||
| 57 | 4 | public function room(string $roomId) |
|
| 63 | |||
| 64 | /** |
||
| 65 | * Set the sender's access token. |
||
| 66 | * |
||
| 67 | * @param string $accessToken |
||
| 68 | * |
||
| 69 | * @return $this |
||
| 70 | */ |
||
| 71 | 3 | public function from(string $accessToken) |
|
| 77 | |||
| 78 | /** |
||
| 79 | * Set the content of the message. Supports GitHub flavoured markdown. |
||
| 80 | * |
||
| 81 | * @param string $content |
||
| 82 | * |
||
| 83 | * @return $this |
||
| 84 | */ |
||
| 85 | 8 | public function content(string $content) |
|
| 91 | } |
||
| 92 |