| 1 | <?php |
||
| 9 | class AbstractOutputContainer |
||
| 10 | { |
||
| 11 | /** @var string */ |
||
| 12 | protected $singleResultMarker; |
||
| 13 | |||
| 14 | /** @var string */ |
||
| 15 | protected $tag; |
||
| 16 | |||
| 17 | /** @var string */ |
||
| 18 | protected $title; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * OutputContainer constructor. |
||
| 22 | * @param string $tag |
||
| 23 | * @param string $title |
||
| 24 | * @param string $singleResultMarker |
||
| 25 | */ |
||
| 26 | 43 | public function __construct($tag, $title, $singleResultMarker) |
|
| 33 | |||
| 34 | /** |
||
| 35 | * @return string |
||
| 36 | */ |
||
| 37 | 17 | public function getTag() |
|
| 41 | |||
| 42 | /** |
||
| 43 | * @return string |
||
| 44 | */ |
||
| 45 | 8 | public function getTitle() |
|
| 49 | |||
| 50 | /** |
||
| 51 | * @return string |
||
| 52 | */ |
||
| 53 | 22 | public function getSingleResultMarker() |
|
| 57 | } |
||
| 58 |
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: