| 1 | <?php |
||
| 16 | class Message implements MessageInterface |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * Message type. |
||
| 20 | * |
||
| 21 | * @var string |
||
| 22 | */ |
||
| 23 | protected $type; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Context. |
||
| 27 | * |
||
| 28 | * @var array |
||
| 29 | */ |
||
| 30 | protected $context = []; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Template handler. |
||
| 34 | * |
||
| 35 | * @var TemplateHandler |
||
| 36 | */ |
||
| 37 | protected $template; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Constructor. |
||
| 41 | */ |
||
| 42 | public function __construct(string $type, TemplateHandler $template, array $context = []) |
||
| 48 | |||
| 49 | /** |
||
| 50 | * {@inheritdoc} |
||
| 51 | */ |
||
| 52 | public function getSubject(?User $user = null): string |
||
| 59 | |||
| 60 | /** |
||
| 61 | * {@inheritdoc} |
||
| 62 | */ |
||
| 63 | public function getBody(?User $user = null): string |
||
| 70 | |||
| 71 | /** |
||
| 72 | * {@inheritdoc} |
||
| 73 | */ |
||
| 74 | public function getContext(): array |
||
| 78 | |||
| 79 | /** |
||
| 80 | * {@inheritdoc} |
||
| 81 | */ |
||
| 82 | public function getType(): string |
||
| 86 | |||
| 87 | /** |
||
| 88 | * {@inheritdoc} |
||
| 89 | */ |
||
| 90 | public function renderTemplate(string $template, ?User $user = null): string |
||
| 97 | } |
||
| 98 |