1 | <?php |
||
33 | abstract class ComponentAbstract implements ComponentInterface |
||
34 | { |
||
35 | |||
36 | /** |
||
37 | * Array of dom attributes |
||
38 | * |
||
39 | * @var array |
||
40 | */ |
||
41 | protected $dom_attributes = array(); |
||
42 | |||
43 | /** |
||
44 | * Array of component scripts |
||
45 | * |
||
46 | * @var array |
||
47 | */ |
||
48 | protected $component_scripts = array(); |
||
49 | |||
50 | /** |
||
51 | * Name of DOM attribute |
||
52 | * |
||
53 | * @var string |
||
54 | */ |
||
55 | protected $dom_attribute_name; |
||
56 | |||
57 | /** |
||
58 | * Loaded Component Method object |
||
59 | * |
||
60 | * @var object |
||
61 | */ |
||
62 | protected $methodProvider; |
||
63 | |||
64 | /** |
||
65 | * Component Constructor |
||
66 | */ |
||
67 | 58 | public function __construct() |
|
72 | |||
73 | |||
74 | /** |
||
75 | * Call passes all calls to no existing methods to self::methodProvider |
||
76 | * |
||
77 | * @param string $method |
||
78 | * @param array $args |
||
79 | * @throws InvalidComponentMethodException |
||
80 | */ |
||
81 | 58 | public function __call(string $method, $args) |
|
96 | |||
97 | /** |
||
98 | * Return DOM attribute contents |
||
99 | * |
||
100 | * @return string |
||
101 | */ |
||
102 | 4 | public function getDomAttributeString(): string |
|
109 | |||
110 | /** |
||
111 | * Set class providing component methods |
||
112 | * |
||
113 | * @param string $method_provider |
||
114 | * @return void |
||
115 | */ |
||
116 | 58 | public function setMethodProvider(string $method_provider = 'DefaultMethods') |
|
121 | |||
122 | /** |
||
123 | * Does component have DOM Atributes |
||
124 | * |
||
125 | * {@inheritdoc} |
||
126 | * |
||
127 | * @return bool |
||
128 | */ |
||
129 | 2 | public function hasDOMAttributes(): bool |
|
133 | |||
134 | /** |
||
135 | * Get component DOM Atributes array |
||
136 | * |
||
137 | * {@inheritdoc} |
||
138 | * |
||
139 | * @return array |
||
140 | */ |
||
141 | 20 | public function getDOMAttributesArray(): array |
|
145 | |||
146 | /** |
||
147 | * Get Component scripts |
||
148 | * |
||
149 | * {@inheritdoc} |
||
150 | * |
||
151 | * @return array |
||
152 | */ |
||
153 | 2 | public function getComponentScripts(): array |
|
157 | |||
158 | /** |
||
159 | * Add component scripts |
||
160 | * |
||
161 | * {@inheritdoc} |
||
162 | * |
||
163 | */ |
||
164 | 1 | public function addComponentScripts(string $vendor_component, string $script_name) |
|
168 | |||
169 | /** |
||
170 | * Get DOMAttr for the entity |
||
171 | * |
||
172 | * @return DOMAttr |
||
173 | */ |
||
174 | 2 | public function getDOMAttr(): DOMAttr |
|
178 | |||
179 | /** |
||
180 | * Get Dom attribute name |
||
181 | * |
||
182 | * @return string |
||
183 | */ |
||
184 | 2 | public function getDomAttributeName(): string |
|
188 | |||
189 | /** |
||
190 | * Set Dom Attribute name |
||
191 | * |
||
192 | * @param string $dom_attribute_name |
||
193 | * @return void |
||
194 | */ |
||
195 | 58 | public function setDomAttributeName(string $dom_attribute_name) |
|
199 | } |
||
200 |
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.