1 | <?php |
||
21 | trait ContentFromTemplateMethods |
||
22 | { |
||
23 | |||
24 | /** |
||
25 | * Gets the Template Engine |
||
26 | * |
||
27 | * @return TemplateEngineInterface |
||
28 | */ |
||
29 | 20 | public function getTemplateEngine() |
|
37 | |||
38 | /** |
||
39 | * Sets the Template Engine |
||
40 | * |
||
41 | * @param TemplateEngineInterface $templateEngine |
||
42 | * |
||
43 | * @return MessageBody|$this|self |
||
44 | */ |
||
45 | 20 | public function setTemplateEngine(TemplateEngineInterface $templateEngine) |
|
50 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: