1 | <?php |
||
9 | class Item |
||
10 | { |
||
11 | use HasAttributes, DisplayRule, IsUrlEqual; |
||
12 | |||
13 | /** |
||
14 | * @var Link |
||
15 | */ |
||
16 | protected $link; |
||
17 | |||
18 | /** |
||
19 | * @var Builder |
||
20 | */ |
||
21 | protected $builder; |
||
22 | |||
23 | /** |
||
24 | * @param Builder $builder |
||
25 | * @param string $name |
||
26 | * @param array $attributes |
||
27 | * @param string $title |
||
28 | * @param string $url |
||
29 | * @param array $linkAttributes |
||
30 | */ |
||
31 | 10 | function __construct(Builder $builder, $name, $attributes = [], $title = '', $url = '#', $linkAttributes = []) |
|
38 | |||
39 | /** |
||
40 | * @return Link |
||
41 | */ |
||
42 | 5 | public function getLink() |
|
46 | |||
47 | /** |
||
48 | * @param array $attributes |
||
49 | * @return string |
||
50 | */ |
||
51 | 3 | public function buildAttributes($attributes = []) |
|
59 | |||
60 | /** |
||
61 | * @return bool |
||
62 | */ |
||
63 | 3 | public function isActive() |
|
70 | } |
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.