1 | <?php |
||
28 | abstract class ToolbarItem |
||
29 | { |
||
30 | |||
31 | /** |
||
32 | * Reference to the object that instantiated the element. |
||
33 | * |
||
34 | * @var Toolbar|null |
||
35 | */ |
||
36 | protected $_parent = null; |
||
37 | |||
38 | /** |
||
39 | * Button view object. |
||
40 | * |
||
41 | * @var ButtonView |
||
42 | */ |
||
43 | protected $_view; |
||
44 | |||
45 | /** |
||
46 | * ToolbarButton constructor. |
||
47 | * |
||
48 | * @param null|Toolbar $parent |
||
49 | */ |
||
50 | public function __construct($parent = null) |
||
51 | { |
||
52 | $this->_parent = $parent; |
||
53 | $this->_view = new ButtonView(); |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * Fetch button id. |
||
58 | * |
||
59 | * @param string $type |
||
60 | * @param string $name |
||
61 | * @return string |
||
62 | * @SuppressWarnings("unused") |
||
63 | */ |
||
64 | public function fetchId($type, $name) |
||
|
|||
65 | { |
||
66 | return Inflector::dasherize($this->_parent->getName()) . '-' . Str::slug($type); |
||
67 | } |
||
68 | |||
69 | /** |
||
70 | * Get the item output. |
||
71 | * |
||
72 | * @return string |
||
73 | */ |
||
74 | abstract public function fetchItem(); |
||
75 | |||
76 | /** |
||
77 | * Render toolbar html. |
||
78 | * |
||
79 | * @param array $node |
||
80 | * @return string |
||
81 | */ |
||
82 | public function render(&$node) |
||
102 | } |
||
103 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.