| 1 | <?php |
||
| 7 | class HtmlString implements Htmlable |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * The HTML string. |
||
| 11 | * |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | protected $html; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Create a new HTML string instance. |
||
| 18 | * |
||
| 19 | * @param string $html |
||
| 20 | * @return void |
||
|
|
|||
| 21 | */ |
||
| 22 | public function __construct($html) |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Get the HTML string. |
||
| 29 | * |
||
| 30 | * @return string |
||
| 31 | */ |
||
| 32 | public function toHtml() |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Get the HTML string. |
||
| 39 | * |
||
| 40 | * @return string |
||
| 41 | */ |
||
| 42 | public function __toString() |
||
| 46 | } |
||
| 47 |
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.