| 1 | <?php |
||
| 7 | class Link |
||
| 8 | { |
||
| 9 | use HasAttributes; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | protected $url; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | protected $title; |
||
| 20 | |||
| 21 | |||
| 22 | 12 | function __construct($title = '', $url = '#', $attributes = []) |
|
| 28 | |||
| 29 | /** |
||
| 30 | * @return string |
||
| 31 | */ |
||
| 32 | 3 | public function getTitle() |
|
| 36 | |||
| 37 | /** |
||
| 38 | * @param string $title |
||
| 39 | */ |
||
| 40 | 3 | public function setTitle($title) |
|
| 46 | |||
| 47 | /** |
||
| 48 | * @return string |
||
| 49 | */ |
||
| 50 | 4 | public function getUrl() |
|
| 54 | |||
| 55 | /** |
||
| 56 | * @param string $url |
||
| 57 | */ |
||
| 58 | 2 | public function setUrl($url) |
|
| 64 | } |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.