1 | <?php |
||
33 | abstract class ComponentAbstract implements ComponentInterface |
||
34 | { |
||
35 | /** |
||
36 | * Array of dom attributes |
||
37 | * |
||
38 | * @var array |
||
39 | */ |
||
40 | protected $dom_attributes = array(); |
||
41 | /** |
||
42 | * Array of component scripts |
||
43 | * |
||
44 | * @var array |
||
45 | */ |
||
46 | protected $component_scripts = array(); |
||
47 | /** |
||
48 | * Name of DOM attribute |
||
49 | * |
||
50 | * @var string |
||
51 | */ |
||
52 | protected $dom_attribute_name; |
||
53 | /** |
||
54 | * Loaded Component Method object |
||
55 | * |
||
56 | * @var object |
||
57 | */ |
||
58 | protected $methodProvider; |
||
59 | |||
60 | /** |
||
61 | * Component Constructor |
||
62 | */ |
||
63 | 64 | public function __construct() |
|
68 | |||
69 | /** |
||
70 | * Call passes all calls to no existing methods to self::methodProvider |
||
71 | * |
||
72 | * @param string $method |
||
73 | * @param array $args |
||
74 | * @throws InvalidComponentMethodException |
||
75 | */ |
||
76 | 52 | public function __call( string $method, $args) |
|
91 | |||
92 | /** |
||
93 | * Return DOM attribute contents |
||
94 | * |
||
95 | * @return string |
||
96 | */ |
||
97 | 6 | public function getDomAttributeString(): string |
|
103 | |||
104 | /** |
||
105 | * Set class providing component methods |
||
106 | * |
||
107 | * @param string $mp |
||
108 | * @return void |
||
109 | */ |
||
110 | 64 | public function setMethodProvider( string $mp = 'DefaultMethods') |
|
115 | |||
116 | /** |
||
117 | * Does component have DOM Atributes |
||
118 | * |
||
119 | * {@inheritdoc} |
||
120 | * |
||
121 | * @return bool |
||
122 | */ |
||
123 | 4 | public function hasDOMAttributes(): bool |
|
127 | |||
128 | /** |
||
129 | * Get component DOM Atributes array |
||
130 | * |
||
131 | * {@inheritdoc} |
||
132 | * |
||
133 | * @return array |
||
134 | */ |
||
135 | 22 | public function getDOMAttributesArray(): array |
|
139 | |||
140 | /** |
||
141 | * Get Component scripts |
||
142 | * |
||
143 | * {@inheritdoc} |
||
144 | * |
||
145 | * @return array |
||
146 | */ |
||
147 | 2 | public function getComponentScripts(): array |
|
151 | |||
152 | /** |
||
153 | * Add component scripts |
||
154 | * |
||
155 | * {@inheritdoc} |
||
156 | * |
||
157 | */ |
||
158 | 1 | public function addComponentScripts( string $vendor_component, string $script_name) |
|
162 | |||
163 | /** |
||
164 | * Get DOMAttr for the entity |
||
165 | * |
||
166 | * @return DOMAttr |
||
167 | */ |
||
168 | 4 | public function getDOMAttr(): DOMAttr |
|
172 | |||
173 | /** |
||
174 | * Get Dom attribute name |
||
175 | * |
||
176 | * @return string |
||
177 | */ |
||
178 | 4 | public function getDomAttributeName(): string |
|
182 | |||
183 | /** |
||
184 | * Set Dom Attribute name |
||
185 | * |
||
186 | * @param string $dom_attribute_name |
||
187 | * @return void |
||
188 | */ |
||
189 | 64 | public function setDomAttribute( string $dom_attribute_name) |
|
193 | } |
||
194 |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.