| 1 | <?php |
||
| 9 | abstract class AbstractElement implements \JsonSerializable |
||
| 10 | { |
||
| 11 | use ValidatorTrait; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @var string |
||
| 15 | */ |
||
| 16 | protected $title; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var string|null |
||
| 20 | */ |
||
| 21 | protected $subtitle; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var string|null |
||
| 25 | */ |
||
| 26 | protected $imageUrl; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * AbstractElement constructor. |
||
| 30 | * |
||
| 31 | * @throws \Kerox\Messenger\Exception\MessengerException |
||
| 32 | */ |
||
| 33 | 11 | public function __construct(string $title) |
|
| 39 | |||
| 40 | /** |
||
| 41 | * @throws \Kerox\Messenger\Exception\MessengerException |
||
| 42 | * |
||
| 43 | * @return mixed |
||
| 44 | */ |
||
| 45 | 11 | public function setSubtitle(string $subtitle) |
|
| 51 | |||
| 52 | /** |
||
| 53 | * @throws \Kerox\Messenger\Exception\MessengerException |
||
| 54 | * |
||
| 55 | * @return mixed |
||
| 56 | */ |
||
| 57 | 11 | public function setImageUrl(string $imageUrl) |
|
| 63 | |||
| 64 | 9 | public function toArray(): array |
|
| 70 | |||
| 71 | 9 | public function jsonSerialize(): array |
|
| 75 | } |
||
| 76 |