| 1 | <?php |
||
| 12 | class Twig implements FileContents, Parameterized |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * The twig template |
||
| 16 | * |
||
| 17 | * @var TwigTemplate |
||
| 18 | **/ |
||
| 19 | private $template; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * The parameters |
||
| 23 | * |
||
| 24 | * @var array[string]string |
||
| 25 | **/ |
||
| 26 | private $parameters; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Constructor |
||
| 30 | * |
||
| 31 | * @param TwigTemplate $template |
||
| 32 | * @param array $parameters |
||
| 33 | * @return void |
||
|
|
|||
| 34 | **/ |
||
| 35 | public function __construct(TwigTemplate $template, array $parameters = array()) |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Get the contents |
||
| 44 | * |
||
| 45 | * @return string |
||
| 46 | **/ |
||
| 47 | public function getContents() |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Get the template |
||
| 54 | * |
||
| 55 | * @return TwigTemplate |
||
| 56 | */ |
||
| 57 | public function getTemplate() |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Set the template |
||
| 64 | * |
||
| 65 | * @param TwigTemplate $template |
||
| 66 | * @return Twig |
||
| 67 | */ |
||
| 68 | public function setTemplate(TwigTemplate $template) |
||
| 74 | |||
| 75 | /** |
||
| 76 | * Get the parameters |
||
| 77 | * |
||
| 78 | * @return array[string]string |
||
| 79 | */ |
||
| 80 | public function getParameters() |
||
| 84 | |||
| 85 | /** |
||
| 86 | * Set the parameters |
||
| 87 | * |
||
| 88 | * @param array[string]string $parameters |
||
| 89 | * @return Twig |
||
| 90 | */ |
||
| 91 | public function setParameters(array $parameters) |
||
| 97 | } |
||
| 98 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.