1 | <?php |
||
12 | trait LinkAttributesSetter |
||
13 | { |
||
14 | /** |
||
15 | * Set a URL or IMG tag's attributes |
||
16 | * |
||
17 | * @param Tag $tag URL or IMG tag |
||
18 | * @param string $linkInfo Link's info: an URL optionally followed by spaces and a title |
||
19 | * @param string $attrName Name of the URL attribute |
||
20 | * @return void |
||
21 | */ |
||
22 | 69 | protected function setLinkAttributes(Tag $tag, $linkInfo, $attrName) |
|
39 | } |
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: