Completed
Push — master ( 988761...5d514e )
by Fenz
02:27
created
libs/Helper/IConfigProvider.php 1 patch
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -12,6 +12,7 @@
 block discarded – undo
12 12
 	 * @access public
13 13
 	 *
14 14
 	 * @param  string ...$key
15
+	 * @param string[] $key
15 16
 	 *
16 17
 	 * @return mixed
17 18
 	 */
Please login to merge, or discard this patch.
libs/ReadingBuffer/Line.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -79,6 +79,7 @@
 block discarded – undo
79 79
 	 *
80 80
 	 * @param  int $start
81 81
 	 * @param  int ...$lengths
82
+	 * @param integer[] $lengths
82 83
 	 *
83 84
 	 * @return string
84 85
 	 */
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	{
46 46
 		false===$content and $this->isLast=true;
47 47
 
48
-		$this->content= rtrim($content,"\n");
48
+		$this->content=rtrim($content, "\n");
49 49
 	}
50 50
 
51 51
 	/**
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	 */
58 58
 	public function getContent():string
59 59
 	{
60
-		return ltrim($this->content,"\t");
60
+		return ltrim($this->content, "\t");
61 61
 	}
62 62
 
63 63
 	/**
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	 */
85 85
 	public function slice( int$start=0, int...$lengths ):string
86 86
 	{
87
-		return substr($this->getContent(),$start,...array_slice($lengths,0,1));
87
+		return substr($this->getContent(), $start, ...array_slice($lengths, 0, 1));
88 88
 	}
89 89
 
90 90
 	/**
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	 */
99 99
 	public function getChar( int$offset ):string
100 100
 	{
101
-		return substr($this->getcontent(),$offset,1);
101
+		return substr($this->getcontent(), $offset, 1);
102 102
 	}
103 103
 
104 104
 	/**
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 	 */
113 113
 	public function pregMatch( string$pattern ):bool
114 114
 	{
115
-		return !!preg_match($pattern,ltrim($this->content,"\t"));
115
+		return !!preg_match($pattern, ltrim($this->content, "\t"));
116 116
 	}
117 117
 
118 118
 	/**
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
 	 */
128 128
 	public function pregGet( string$pattern, /*int|string*/$match=0 ):string
129 129
 	{
130
-		preg_match($pattern,ltrim($this->content,"\t"),$matches);
131
-		return $matches[$match]??'';
130
+		preg_match($pattern, ltrim($this->content, "\t"), $matches);
131
+		return $matches[ $match ]??'';
132 132
 	}
133 133
 
134 134
 	/**
@@ -143,8 +143,8 @@  discard block
 block discarded – undo
143 143
 	 */
144 144
 	public function pregMap( string$pattern, callable$callback ):array
145 145
 	{
146
-		preg_match_all($pattern,ltrim($this->content,"\t"),$matches);
147
-		return array_map($callback,...$matches);
146
+		preg_match_all($pattern, ltrim($this->content, "\t"), $matches);
147
+		return array_map($callback, ...$matches);
148 148
 	}
149 149
 
150 150
 	/**
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 	 */
157 157
 	public function getIndentLevel():int
158 158
 	{
159
-		return strlen($this->content)-strlen(ltrim($this->content,"\t"));
159
+		return strlen($this->content)-strlen(ltrim($this->content, "\t"));
160 160
 	}
161 161
 
162 162
 	/**
@@ -228,6 +228,6 @@  discard block
 block discarded – undo
228 228
 	 */
229 229
 	public function getSubIndentLine():self
230 230
 	{
231
-		return new static(ltrim($this->getContent(),' '));
231
+		return new static(ltrim($this->getContent(), ' '));
232 232
 	}
233 233
 }
Please login to merge, or discard this patch.
libs/Helper/DefaultConfigs.php 1 patch
Spacing   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -198,70 +198,70 @@  discard block
 block discarded – undo
198 198
 				],
199 199
 			],
200 200
 			'tag_nodes'=> [
201
-				'SVG1.1'=> $svgTags= [
201
+				'SVG1.1'=> $svgTags=[
202 202
 					'svg'=> [
203 203
 						'out'=> [
204
-							'default_attributes'=> ['xmlns'=> 'http://www.w3.org/2000/svg','version'=> '1.1',],
205
-							'params'=> ['viewBox',],
204
+							'default_attributes'=> [ 'xmlns'=> 'http://www.w3.org/2000/svg', 'version'=> '1.1', ],
205
+							'params'=> [ 'viewBox', ],
206 206
 							'scope'=> 'svg',
207 207
 						],
208 208
 						'in'=> [
209 209
 							'svg'=> [
210
-								'params'=> ['x','y','width','height',],
210
+								'params'=> [ 'x', 'y', 'width', 'height', ],
211 211
 							],
212 212
 						],
213 213
 					],
214
-					'*'=> [],
214
+					'*'=> [ ],
215 215
 					'polygon'=> [
216
-						'params'=> ['points',],
217
-						'only_in'=> ['svg',],
216
+						'params'=> [ 'points', ],
217
+						'only_in'=> [ 'svg', ],
218 218
 					],
219 219
 					'polyline'=> [
220
-						'params'=> ['points',],
221
-						'only_in'=> ['svg',],
220
+						'params'=> [ 'points', ],
221
+						'only_in'=> [ 'svg', ],
222 222
 					],
223 223
 					'path'=> [
224
-						'params'=> ['d',],
225
-						'only_in'=> ['svg',],
224
+						'params'=> [ 'd', ],
225
+						'only_in'=> [ 'svg', ],
226 226
 					],
227 227
 					'line'=> [
228
-						'params'=> ['x1','y1','x2','y2',],
229
-						'only_in'=> ['svg',],
228
+						'params'=> [ 'x1', 'y1', 'x2', 'y2', ],
229
+						'only_in'=> [ 'svg', ],
230 230
 					],
231 231
 					'rect'=> [
232
-						'params'=> ['x','y','width','height',],
233
-						'only_in'=> ['svg',],
232
+						'params'=> [ 'x', 'y', 'width', 'height', ],
233
+						'only_in'=> [ 'svg', ],
234 234
 					],
235 235
 					'circle'=> [
236
-						'params'=> ['cx','cy','r',],
237
-						'only_in'=> ['svg',],
236
+						'params'=> [ 'cx', 'cy', 'r', ],
237
+						'only_in'=> [ 'svg', ],
238 238
 					],
239 239
 					'ellipse'=> [
240
-						'params'=> ['cx','cy','rx','ry',],
241
-						'only_in'=> ['svg',],
240
+						'params'=> [ 'cx', 'cy', 'rx', 'ry', ],
241
+						'only_in'=> [ 'svg', ],
242 242
 					],
243 243
 					'text'=> [
244
-						'params'=> ['x','y',],
245
-						'only_in'=> ['svg',],
244
+						'params'=> [ 'x', 'y', ],
245
+						'only_in'=> [ 'svg', ],
246 246
 					],
247 247
 				],
248 248
 				'HTML5'=> [
249
-					'*'=> [],
249
+					'*'=> [ ],
250 250
 					''=> [
251 251
 						'opener'=> ' ',
252 252
 						'closer'=> '',
253 253
 					],
254 254
 					'charset'=> [
255 255
 						'name'=> 'meta',
256
-						'params'=> ['charset',],
256
+						'params'=> [ 'charset', ],
257 257
 					],
258 258
 					'equiv'=> [
259 259
 						'name'=> 'meta',
260
-						'name_value'=> ['http-equiv','content','scheme',],
260
+						'name_value'=> [ 'http-equiv', 'content', 'scheme', ],
261 261
 					],
262 262
 					'meta'=> [
263 263
 						'name'=> 'meta',
264
-						'name_value'=> ['name','content','scheme',],
264
+						'name_value'=> [ 'name', 'content', 'scheme', ],
265 265
 					],
266 266
 					'php'=> [
267 267
 						'opener'=> '<?php ',
@@ -273,14 +273,14 @@  discard block
 block discarded – undo
273 273
 						'multiple'=> [
274 274
 							[
275 275
 								'pattern'=> '/\{>$/',
276
-								'params'=> ['type',],
277
-								'default_attributes'=> ['codeset'=> 'codeset',],
276
+								'params'=> [ 'type', ],
277
+								'default_attributes'=> [ 'codeset'=> 'codeset', ],
278 278
 								'embedding'=> 'code',
279 279
 							],
280 280
 							[
281 281
 								'pattern'=> '/.?/',
282 282
 								'name'=> 'code',
283
-								'params'=> ['type',],
283
+								'params'=> [ 'type', ],
284 284
 							],
285 285
 						],
286 286
 					],
@@ -289,13 +289,13 @@  discard block
 block discarded – undo
289 289
 							[
290 290
 								'pattern'=> '/^-js @/',
291 291
 								'name'=> 'script',
292
-								'default_attributes'=> ['type'=> 'text/javascript',],
292
+								'default_attributes'=> [ 'type'=> 'text/javascript', ],
293 293
 								'link'=> 'src',
294 294
 							],
295 295
 							[
296 296
 								'pattern'=> '/^-js\{>/',
297 297
 								'name'=> 'script',
298
-								'default_attributes'=> ['type'=> 'text/javascript',],
298
+								'default_attributes'=> [ 'type'=> 'text/javascript', ],
299 299
 								'embedding'=> 'js',
300 300
 							],
301 301
 						],
@@ -305,96 +305,96 @@  discard block
 block discarded – undo
305 305
 							[
306 306
 								'pattern'=> '/^-css @/',
307 307
 								'name'=> 'link',
308
-								'default_attributes'=> ['rel'=> 'stylesheet','type'=> 'text/css',],
308
+								'default_attributes'=> [ 'rel'=> 'stylesheet', 'type'=> 'text/css', ],
309 309
 								'link'=> 'href',
310 310
 							],
311 311
 							[
312 312
 								'pattern'=> '/^-css\{>/',
313 313
 								'name'=> 'style',
314
-								'default_attributes'=> ['type'=> 'text/css',],
314
+								'default_attributes'=> [ 'type'=> 'text/css', ],
315 315
 								'embedding'=> 'css',
316 316
 							],
317 317
 						],
318 318
 					],
319 319
 					'icon'=> [
320 320
 						'name'=> 'link',
321
-						'default_attributes'=> ['rel'=> 'icon',],
322
-						'params'=> ['sizes',],
321
+						'default_attributes'=> [ 'rel'=> 'icon', ],
322
+						'params'=> [ 'sizes', ],
323 323
 						'link'=> 'href',
324 324
 					],
325 325
 					'shortcut'=> [
326 326
 						'name'=> 'link',
327
-						'default_attributes'=> ['rel'=> 'shortcut icon','type'=> 'image/x-icon',],
327
+						'default_attributes'=> [ 'rel'=> 'shortcut icon', 'type'=> 'image/x-icon', ],
328 328
 						'link'=> 'href',
329 329
 					],
330 330
 					'link'=> [
331
-						'params'=> ['rel',],
331
+						'params'=> [ 'rel', ],
332 332
 						'link'=> 'href',
333 333
 					],
334 334
 					'script'=> [
335
-						'params'=> ['type',],
335
+						'params'=> [ 'type', ],
336 336
 						'link'=> 'source',
337 337
 					],
338 338
 					'a'=> [
339 339
 						'link'=> 'href',
340
-						'name_value'=> ['name',],
340
+						'name_value'=> [ 'name', ],
341 341
 						'target'=> 'target',
342 342
 					],
343 343
 					'iframe'=> [
344 344
 						'link'=> 'src',
345
-						'default_attributes'=> ['frameborder'=> '0',],
346
-						'name_value'=> ['name',],
345
+						'default_attributes'=> [ 'frameborder'=> '0', ],
346
+						'name_value'=> [ 'name', ],
347 347
 					],
348 348
 					'img'=> [
349 349
 						'link'=> 'src',
350 350
 						'alt'=> 'alt',
351 351
 					],
352
-					'fpost'=>   ['name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> ['name',], 'default_attributes'=> ['method'=> 'post',],],
353
-					'fupload'=> ['name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> ['name',], 'default_attributes'=> ['method'=> 'post','enctype'=> 'multipart/form-data',],],
354
-					'fget'=>    ['name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> ['name',], 'default_attributes'=> ['method'=> 'get',],],
355
-					'fput'=>    ['name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> ['name',], 'default_attributes'=> ['method'=> 'put',],],
356
-					'fpatch'=>  ['name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> ['name',], 'default_attributes'=> ['method'=> 'patch',],],
357
-					'fdelete'=> ['name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> ['name',], 'default_attributes'=> ['method'=> 'delete',],],
352
+					'fpost'=>   [ 'name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> [ 'name', ], 'default_attributes'=> [ 'method'=> 'post', ], ],
353
+					'fupload'=> [ 'name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> [ 'name', ], 'default_attributes'=> [ 'method'=> 'post', 'enctype'=> 'multipart/form-data', ], ],
354
+					'fget'=>    [ 'name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> [ 'name', ], 'default_attributes'=> [ 'method'=> 'get', ], ],
355
+					'fput'=>    [ 'name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> [ 'name', ], 'default_attributes'=> [ 'method'=> 'put', ], ],
356
+					'fpatch'=>  [ 'name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> [ 'name', ], 'default_attributes'=> [ 'method'=> 'patch', ], ],
357
+					'fdelete'=> [ 'name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> [ 'name', ], 'default_attributes'=> [ 'method'=> 'delete', ], ],
358 358
 
359
-					'fhidden'=>         ['name'=> 'input',  'default_attributes'=> ['type'=> 'hidden',],         'name_value'=> ['name', 'value', 'form',],],
360
-					'ftext'=>           ['name'=> 'input',  'default_attributes'=> ['type'=> 'text',],           'name_value'=> ['name', 'value', 'form',], 'alt'=> 'placeholder',],
361
-					'fsearch'=>         ['name'=> 'input',  'default_attributes'=> ['type'=> 'search',],         'name_value'=> ['name', 'value', 'form',], 'alt'=> 'placeholder',],
362
-					'fpassword'=>       ['name'=> 'input',  'default_attributes'=> ['type'=> 'password',],       'name_value'=> ['name', 'value', 'form',], 'alt'=> 'placeholder',],
363
-					'femail'=>          ['name'=> 'input',  'default_attributes'=> ['type'=> 'email',],          'name_value'=> ['name', 'value', 'form',], 'alt'=> 'placeholder',],
364
-					'furl'=>            ['name'=> 'input',  'default_attributes'=> ['type'=> 'url',],            'name_value'=> ['name', 'value', 'form',], 'alt'=> 'placeholder',],
365
-					'ftel'=>            ['name'=> 'input',  'default_attributes'=> ['type'=> 'tel',],            'name_value'=> ['name', 'value', 'form',], 'alt'=> 'placeholder',],
366
-					'fnumber'=>         ['name'=> 'input',  'default_attributes'=> ['type'=> 'number',],         'name_value'=> ['name', 'value', 'form',], 'alt'=> 'placeholder', 'params'=> ['min', 'step', 'max',],],
367
-					'frange'=>          ['name'=> 'input',  'default_attributes'=> ['type'=> 'range',],          'name_value'=> ['name', 'value', 'form',],                'params'=> ['min', 'step', 'max',],],
368
-					'fradio'=>          ['name'=> 'input',  'default_attributes'=> ['type'=> 'radio',],          'name_value'=> ['name', 'value', 'form',],],
369
-					'fcheckbox'=>       ['name'=> 'input',  'default_attributes'=> ['type'=> 'checkbox',],       'name_value'=> ['name', 'value', 'form',],],
370
-					'fdate'=>           ['name'=> 'input',  'default_attributes'=> ['type'=> 'date',],           'name_value'=> ['name', 'value', 'form',],],
371
-					'fmonth'=>          ['name'=> 'input',  'default_attributes'=> ['type'=> 'month',],          'name_value'=> ['name', 'value', 'form',],],
372
-					'fweek'=>           ['name'=> 'input',  'default_attributes'=> ['type'=> 'week',],           'name_value'=> ['name', 'value', 'form',],],
373
-					'ftime'=>           ['name'=> 'input',  'default_attributes'=> ['type'=> 'time',],           'name_value'=> ['name', 'value', 'form',],],
374
-					'fdatetime'=>       ['name'=> 'input',  'default_attributes'=> ['type'=> 'datetime',],       'name_value'=> ['name', 'value', 'form',],],
375
-					'fdatetime-local'=> ['name'=> 'input',  'default_attributes'=> ['type'=> 'datetime-local',], 'name_value'=> ['name', 'value', 'form',],],
376
-					'fcolor'=>          ['name'=> 'input',  'default_attributes'=> ['type'=> 'color',],          'name_value'=> ['name', 'value', 'form',],],
377
-					'ffile'=>           ['name'=> 'input',  'default_attributes'=> ['type'=> 'file',],           'name_value'=> ['name', 'form',], 'params'=> ['accept',],],
359
+					'fhidden'=>         [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'hidden', ], 'name_value'=> [ 'name', 'value', 'form', ], ],
360
+					'ftext'=>           [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'text', ], 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', ],
361
+					'fsearch'=>         [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'search', ], 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', ],
362
+					'fpassword'=>       [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'password', ], 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', ],
363
+					'femail'=>          [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'email', ], 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', ],
364
+					'furl'=>            [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'url', ], 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', ],
365
+					'ftel'=>            [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'tel', ], 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', ],
366
+					'fnumber'=>         [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'number', ], 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', 'params'=> [ 'min', 'step', 'max', ], ],
367
+					'frange'=>          [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'range', ], 'name_value'=> [ 'name', 'value', 'form', ], 'params'=> [ 'min', 'step', 'max', ], ],
368
+					'fradio'=>          [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'radio', ], 'name_value'=> [ 'name', 'value', 'form', ], ],
369
+					'fcheckbox'=>       [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'checkbox', ], 'name_value'=> [ 'name', 'value', 'form', ], ],
370
+					'fdate'=>           [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'date', ], 'name_value'=> [ 'name', 'value', 'form', ], ],
371
+					'fmonth'=>          [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'month', ], 'name_value'=> [ 'name', 'value', 'form', ], ],
372
+					'fweek'=>           [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'week', ], 'name_value'=> [ 'name', 'value', 'form', ], ],
373
+					'ftime'=>           [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'time', ], 'name_value'=> [ 'name', 'value', 'form', ], ],
374
+					'fdatetime'=>       [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'datetime', ], 'name_value'=> [ 'name', 'value', 'form', ], ],
375
+					'fdatetime-local'=> [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'datetime-local', ], 'name_value'=> [ 'name', 'value', 'form', ], ],
376
+					'fcolor'=>          [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'color', ], 'name_value'=> [ 'name', 'value', 'form', ], ],
377
+					'ffile'=>           [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'file', ], 'name_value'=> [ 'name', 'form', ], 'params'=> [ 'accept', ], ],
378 378
 
379
-					'fsubmit'=>         ['name'=> 'button', 'default_attributes'=> ['type'=> 'submit',],         'name_value'=> ['name', 'value','form',], 'link'=> 'formaction', 'target'=> 'formtarget',],
380
-					'freset'=>          ['name'=> 'button', 'default_attributes'=> ['type'=> 'reset',],          'name_value'=> ['form',],],
381
-					'button'=>         ['name'=> 'button', 'default_attributes'=> ['type'=> 'button',],],
379
+					'fsubmit'=>         [ 'name'=> 'button', 'default_attributes'=> [ 'type'=> 'submit', ], 'name_value'=> [ 'name', 'value', 'form', ], 'link'=> 'formaction', 'target'=> 'formtarget', ],
380
+					'freset'=>          [ 'name'=> 'button', 'default_attributes'=> [ 'type'=> 'reset', ], 'name_value'=> [ 'form', ], ],
381
+					'button'=>         [ 'name'=> 'button', 'default_attributes'=> [ 'type'=> 'button', ], ],
382 382
 
383
-					'ftextarea'=>       ['name'=> 'textarea', 'name_value'=> ['name','value','form',],'alt'=> 'placeholder',],
383
+					'ftextarea'=>       [ 'name'=> 'textarea', 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', ],
384 384
 
385 385
 					'fselect'=> [
386 386
 						'name'=> 'select',
387
-						'name_value'=> ['name', 'value','form',],
387
+						'name_value'=> [ 'name', 'value', 'form', ],
388 388
 						'scope'=> 'select',
389 389
 					],
390 390
 					'datalist'=> [
391
-						'params'=> ['id',],
391
+						'params'=> [ 'id', ],
392 392
 						'scope'=> 'datalist',
393 393
 					],
394 394
 					'optgroup'=> [
395 395
 						'in'=> [
396 396
 							'select'=> [
397
-								'name_value'=> ['label',],
397
+								'name_value'=> [ 'label', ],
398 398
 							],
399 399
 						],
400 400
 					],
@@ -402,24 +402,24 @@  discard block
 block discarded – undo
402 402
 						'in'=> [
403 403
 							'select'=> [
404 404
 								'scope_function'=> function( $scope ){
405
-									if( $scope['value']===$this['value'] ){
406
-										$this['selected']= 'selected';
405
+									if( $scope[ 'value' ]===$this[ 'value' ] ){
406
+										$this[ 'selected' ]='selected';
407 407
 									};
408 408
 								},
409
-								'name_value'=> ['value',],
409
+								'name_value'=> [ 'value', ],
410 410
 								'alt'=> 'label',
411 411
 							],
412 412
 							'datalist'=> [
413
-								'name_value'=> ['value',],
413
+								'name_value'=> [ 'value', ],
414 414
 							],
415 415
 						],
416 416
 					],
417 417
 
418 418
 					'param'=> [
419
-						'name_value'=> ['name','value',],
419
+						'name_value'=> [ 'name', 'value', ],
420 420
 					],
421 421
 					'source'=> [
422
-						'params'=>['type',],
422
+						'params'=>[ 'type', ],
423 423
 						'link'=> 'src',
424 424
 					],
425 425
 					'base'=> [
@@ -427,14 +427,14 @@  discard block
 block discarded – undo
427 427
 						'target'=> 'target',
428 428
 					],
429 429
 					'map'=> [
430
-						'params'=> ['name',],
430
+						'params'=> [ 'name', ],
431 431
 						'scope'=> 'area-map',
432 432
 					],
433 433
 					'area'=> [
434 434
 						'link'=> 'href',
435
-						'params'=> ['shape','coords'],
435
+						'params'=> [ 'shape', 'coords' ],
436 436
 						'target'=> 'target',
437
-						'only_in'=> ['area-map',],
437
+						'only_in'=> [ 'area-map', ],
438 438
 					],
439 439
 					'audio'=> [
440 440
 						'link'=> 'src',
@@ -444,11 +444,11 @@  discard block
 block discarded – undo
444 444
 					],
445 445
 					'track'=> [
446 446
 						'link'=> 'src',
447
-						'param'=> ['kind',],
447
+						'param'=> [ 'kind', ],
448 448
 						'alt'=> 'label',
449 449
 					],
450 450
 					'progress'=> [
451
-						'param'=> ['value','max',],
451
+						'param'=> [ 'value', 'max', ],
452 452
 					],
453 453
 				]+$svgTags,
454 454
 			],
Please login to merge, or discard this patch.
libs/Parser/Node/TagNode.php 3 patches
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	 *
51 51
 	 * @var array
52 52
 	 */
53
-	private $attributes=[];
53
+	private $attributes=[ ];
54 54
 
55 55
 	/**
56 56
 	 * Real constructor.
@@ -62,14 +62,14 @@  discard block
 block discarded – undo
62 62
 	protected function construct():parent
63 63
 	{
64 64
 
65
-		$name= $this->line->pregGet('/(?<=^-)[\w-:]+/');
65
+		$name=$this->line->pregGet('/(?<=^-)[\w-:]+/');
66 66
 		$this->name=$name;
67 67
 
68
-		$this->loadConfig($name,$this->document);
68
+		$this->loadConfig($name, $this->document);
69 69
 
70
-		$this->tagName=$this->config['name']??$name;
71
-		$this->isEmpty= $this->line->getChar(-1)==='/' || $this->document->getConfig('empty_tags',$this->tagName);
72
-		isset($this->config['default_attributes']) and array_walk($this->config['default_attributes'],function( $value,$key ){ $this->setAttribute($key,$value); });
70
+		$this->tagName=$this->config[ 'name' ]??$name;
71
+		$this->isEmpty=$this->line->getChar(-1)==='/' || $this->document->getConfig('empty_tags', $this->tagName);
72
+		isset($this->config[ 'default_attributes' ]) and array_walk($this->config[ 'default_attributes' ], function( $value, $key ){ $this->setAttribute($key, $value); });
73 73
 
74 74
 		return $this;
75 75
 	}
@@ -83,16 +83,16 @@  discard block
 block discarded – undo
83 83
 	 */
84 84
 	public function open():string
85 85
 	{
86
-		if( isset($this->config['opener']) )
87
-			{ return $this->config['opener']; }
86
+		if( isset($this->config[ 'opener' ]) )
87
+			{ return $this->config[ 'opener' ]; }
88 88
 
89 89
 		$this->parsePrivateAttributes();
90 90
 		$this->parseCommonAttributes();
91 91
 
92
-		if( isset($this->config['in_scope']) && isset($this->config['scope_function']) && is_callable($this->config['scope_function']) )
93
-			{ $this->config['scope_function']->call($this,$this->document->scope); }
92
+		if( isset($this->config[ 'in_scope' ]) && isset($this->config[ 'scope_function' ]) && is_callable($this->config[ 'scope_function' ]) )
93
+			{ $this->config[ 'scope_function' ]->call($this, $this->document->scope); }
94 94
 
95
-		$finisher= $this->isEmpty ? ' />' : '>';
95
+		$finisher=$this->isEmpty? ' />' : '>';
96 96
 
97 97
 		return "<{$this->tagName}{$this->attributesString}{$finisher}";
98 98
 	}
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	 */
109 109
 	public function close( Line$closerLine ):string
110 110
 	{
111
-		return $this->isEmpty ? '' : $this->config['closer']??"</{$this->tagName}>";
111
+		return $this->isEmpty? '' : $this->config[ 'closer' ]??"</{$this->tagName}>";
112 112
 	}
113 113
 
114 114
 	/**
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	 */
121 121
 	public function getEmbed():string
122 122
 	{
123
-		return $this->config['embedding']??'';
123
+		return $this->config[ 'embedding' ]??'';
124 124
 	}
125 125
 
126 126
 	/**
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 	 */
133 133
 	public function getScope()
134 134
 	{
135
-		return $this->config['scope']??null;
135
+		return $this->config[ 'scope' ]??null;
136 136
 	}
137 137
 
138 138
 	/**
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 	protected function parsePrivateAttributes():self
146 146
 	{
147 147
 		foreach( self::PRIVATE_ATTRIBUTES as $attribute ){
148
-			isset($this->config[$attribute]) and $this->{'parse'.Helper\camel_case($attribute)}();
148
+			isset($this->config[ $attribute ]) and $this->{'parse'.Helper\camel_case($attribute)}();
149 149
 		}
150 150
 
151 151
 		return $this;
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 	 *
161 161
 	 * @todo Make this const private when php 7.1
162 162
 	 */
163
-	const PRIVATE_ATTRIBUTES= [
163
+	const PRIVATE_ATTRIBUTES=[
164 164
 		'params',
165 165
 		'name_value',
166 166
 		'link',
@@ -177,11 +177,11 @@  discard block
 block discarded – undo
177 177
 	 */
178 178
 	protected function parseParams():self
179 179
 	{
180
-		$params= preg_split('/(?<!\\\\)\\|/',$this->line->pregGet('/^-[\w-:]+\((.*?)\)(?= |(\\{>)?$)/',1));
180
+		$params=preg_split('/(?<!\\\\)\\|/', $this->line->pregGet('/^-[\w-:]+\((.*?)\)(?= |(\\{>)?$)/', 1));
181 181
 
182
-		if( ($m= count($params)) != ($n= count($this->config['params'])) ){$this->document->throw("Tag $this->name has $n parameters $m given.");}
182
+		if( ($m=count($params))!=($n=count($this->config[ 'params' ])) ){$this->document->throw("Tag $this->name has $n parameters $m given."); }
183 183
 
184
-		array_map(function( $key, $value ){return $this->setAttribute($key,$this->checkExpression(str_replace('\\|','|',$value)));},$this->config['params'],$params);
184
+		array_map(function( $key, $value ){return $this->setAttribute($key, $this->checkExpression(str_replace('\\|', '|', $value))); },$this->config[ 'params' ], $params);
185 185
 
186 186
 		return $this;
187 187
 	}
@@ -195,9 +195,9 @@  discard block
 block discarded – undo
195 195
 	 */
196 196
 	protected function parseNameValue():self
197 197
 	{
198
-		$params= $this->line->pregGet('/ <(.*?)>(?= |$)/',1)
199
-		 and $params= preg_split('/(?<!\\\\)\\|/',$params)
200
-		  and array_map(function( $key, $value ){return isset($key)&&isset($value) ? $this->setAttribute($key,$this->checkExpression(str_replace('\\|','|',$value))) : '';},$this->config['name_value'],$params);
198
+		$params=$this->line->pregGet('/ <(.*?)>(?= |$)/', 1)
199
+		 and $params=preg_split('/(?<!\\\\)\\|/', $params)
200
+		  and array_map(function( $key, $value ){return isset($key) && isset($value)? $this->setAttribute($key, $this->checkExpression(str_replace('\\|', '|', $value))) : ''; },$this->config[ 'name_value' ], $params);
201 201
 
202 202
 		return $this;
203 203
 	}
@@ -239,13 +239,13 @@  discard block
 block discarded – undo
239 239
 	 */
240 240
 	protected function parseLink():self
241 241
 	{
242
-		return $this->setMultinameAttribute('link',$this->sectionLedBy('@',true),function( string$link ){
243
-			if( isset($this->config['target']) && ':'===$link{0} ){
242
+		return $this->setMultinameAttribute('link', $this->sectionLedBy('@', true), function( string$link ){
243
+			if( isset($this->config[ 'target' ]) && ':'===$link{0} ){
244 244
 				return 'javascript'.$link;
245
-			}elseif( '//'===($firstTwoLetters=substr($link,0,2)) ){
245
+			}elseif( '//'===($firstTwoLetters=substr($link, 0, 2)) ){
246 246
 				return 'http:'.$link;
247 247
 			}elseif( '\\\\'===$firstTwoLetters ){
248
-				return 'https://'.substr($link,2);
248
+				return 'https://'.substr($link, 2);
249 249
 			}else{
250 250
 				return $this->checkExpression($link);
251 251
 			}
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 	 */
262 262
 	protected function parseTarget():self
263 263
 	{
264
-		return $this->setMultinameAttribute('target',$this->sectionLedBy('>',true));
264
+		return $this->setMultinameAttribute('target', $this->sectionLedBy('>', true));
265 265
 	}
266 266
 
267 267
 	/**
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 	 */
274 274
 	protected function parseAlt():self
275 275
 	{
276
-		return $this->setMultinameAttribute('alt',$this->sectionLedBy('_',true));
276
+		return $this->setMultinameAttribute('alt', $this->sectionLedBy('_', true));
277 277
 	}
278 278
 
279 279
 	/**
@@ -289,8 +289,8 @@  discard block
 block discarded – undo
289 289
 	 */
290 290
 	private function setMultinameAttribute( string$name, string$value, callable$processer=null ):self
291 291
 	{
292
-		if( strlen($value) && !empty($this->config[$name]) ){
293
-			return $this->setAttribute($this->config[$name],call_user_func($processer??[$this,'checkExpression',],$value));
292
+		if( strlen($value) && !empty($this->config[ $name ]) ){
293
+			return $this->setAttribute($this->config[ $name ], call_user_func($processer??[ $this, 'checkExpression', ], $value));
294 294
 		}
295 295
 
296 296
 		return $this;
@@ -305,33 +305,33 @@  discard block
 block discarded – undo
305 305
 	 */
306 306
 	protected function parseCommonAttributes():string
307 307
 	{
308
-		$attributes= '';
308
+		$attributes='';
309 309
 
310
-		$id= $this->sectionLedBy('#')
311
-		 and $this->setAttribute('id',$id);
310
+		$id=$this->sectionLedBy('#')
311
+		 and $this->setAttribute('id', $id);
312 312
 
313
-		$classes= $this->line->pregGet('/ \.[^ ]+(?= |$)/')
314
-		 and preg_match_all('/\.((?(?!\()[^.]+|(?<exp>\((?:[^()]+|(?&exp)?)+?\))))/',$classes,$matches)
315
-		  and $classes= implode(' ',array_filter(array_map(function( $className ){return $this->checkExpression($className);},$matches[1])))
316
-		   and $this->setAttribute('class',$classes);
313
+		$classes=$this->line->pregGet('/ \.[^ ]+(?= |$)/')
314
+		 and preg_match_all('/\.((?(?!\()[^.]+|(?<exp>\((?:[^()]+|(?&exp)?)+?\))))/', $classes, $matches)
315
+		  and $classes=implode(' ', array_filter(array_map(function( $className ){return $this->checkExpression($className); },$matches[ 1 ])))
316
+		   and $this->setAttribute('class', $classes);
317 317
 
318
-		$title= $this->sectionLedBy('^',true)
319
-		 and $this->setAttribute('title',$this->checkExpression($title));
318
+		$title=$this->sectionLedBy('^', true)
319
+		 and $this->setAttribute('title', $this->checkExpression($title));
320 320
 
321
-		$style= $this->line->pregGet('/ \[([^\]]+;)(?=\]( |$))/',1)
322
-		 and $this->setAttribute('style',$style);
321
+		$style=$this->line->pregGet('/ \[([^\]]+;)(?=\]( |$))/', 1)
322
+		 and $this->setAttribute('style', $style);
323 323
 
324
-		$eventListeners= $this->line->pregMap('/ %(\w+)\{>(.*?)<\}(?= |$)/',function( $string, $name, $code ){
325
-			$this->setAttribute('on'.$name,str_replace('"','&quot;',$code));
324
+		$eventListeners=$this->line->pregMap('/ %(\w+)\{>(.*?)<\}(?= |$)/', function( $string, $name, $code ){
325
+			$this->setAttribute('on'.$name, str_replace('"', '&quot;', $code));
326 326
 		})
327
-		 and implode('',$eventListeners);
327
+		 and implode('', $eventListeners);
328 328
 
329
-		$other= $this->line->pregGet('/(?<=\{).*?(?=;\}( |$))/')
329
+		$other=$this->line->pregGet('/(?<=\{).*?(?=;\}( |$))/')
330 330
 		 and array_map(function( $keyValue ){
331
-			preg_replace_callback('/^([\w-:]+)(?:\?(.+?))?(?:\=(.*))?$/',function($matches){
332
-				$this->setAttribute($matches[1],(isset($matches[3])? $this->checkExpression($matches[3]) : $matches[1]),$matches[2]??null);
331
+			preg_replace_callback('/^([\w-:]+)(?:\?(.+?))?(?:\=(.*))?$/', function( $matches ){
332
+				$this->setAttribute($matches[ 1 ], (isset($matches[ 3 ])? $this->checkExpression($matches[ 3 ]) : $matches[ 1 ]), $matches[ 2 ]??null);
333 333
 			},$keyValue);
334
-		},explode(';',$other));
334
+		},explode(';', $other));
335 335
 
336 336
 		return $attributes;
337 337
 	}
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 	 */
348 348
 	protected function checkExpression( string$value ):string
349 349
 	{
350
-		return preg_match('/^\(.*\)$/',$value) ? '<?=str_replace(\'"\',\'&quot;\','.substr($value,1,-1).')?>' : str_replace('"','&quot;',$value);
350
+		return preg_match('/^\(.*\)$/', $value)? '<?=str_replace(\'"\',\'&quot;\','.substr($value, 1, -1).')?>' : str_replace('"', '&quot;', $value);
351 351
 	}
352 352
 
353 353
 	/**
@@ -360,13 +360,13 @@  discard block
 block discarded – undo
360 360
 	protected function getAttributesString():string
361 361
 	{
362 362
 		ksort($this->attributes);
363
-		return implode('',array_map(static function( string$key, array$data ){
364
-			return (isset($data['condition'])&&strlen($data['condition'])?
365
-				"<?php if( {$data['condition']} ){?> $key=\"{$data['value']}\"<?php }?>"
363
+		return implode('', array_map(static function( string$key, array$data ){
364
+			return (isset($data[ 'condition' ]) && strlen($data[ 'condition' ])?
365
+				"<?php if( {$data[ 'condition' ]} ){?> $key=\"{$data[ 'value' ]}\"<?php }?>"
366 366
 				:
367
-				" $key=\"{$data['value']}\""
367
+				" $key=\"{$data[ 'value' ]}\""
368 368
 			);
369
-		},array_keys($this->attributes),$this->attributes));
369
+		},array_keys($this->attributes), $this->attributes));
370 370
 	}
371 371
 
372 372
 	/**
@@ -380,10 +380,10 @@  discard block
 block discarded – undo
380 380
 	 */
381 381
 	protected function setAttribute( string$key, string$value, string$condition=null ):self
382 382
 	{
383
-		if( isset($this->attributes[$key]) )
383
+		if( isset($this->attributes[ $key ]) )
384 384
 			{ $this->document->throw("Attribute $key of $this->name cannot redeclare."); }
385 385
 
386
-		$this->attributes[$key]=[
386
+		$this->attributes[ $key ]=[
387 387
 			'value'=> $value,
388 388
 			'condition'=> $condition,
389 389
 		];
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
 	 */
408 408
 	public function offsetExists( $offset ):bool
409 409
 	{
410
-		return isset($this->attributes[$offset]);
410
+		return isset($this->attributes[ $offset ]);
411 411
 	}
412 412
 
413 413
 	/**
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
 	 */
422 422
 	public function offsetGet( $offset )
423 423
 	{
424
-		return $this->attributes[$offset]??null;
424
+		return $this->attributes[ $offset ]??null;
425 425
 	}
426 426
 
427 427
 	/**
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 	 */
435 435
 	public function offsetSet( $offset, $value )
436 436
 	{
437
-		$this->setAttribute($offset,$value);
437
+		$this->setAttribute($offset, $value);
438 438
 	}
439 439
 
440 440
 	/**
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 	 */
447 447
 	public function offsetUnset( $offset )
448 448
 	{
449
-		if( isset($this->attributes[$offset]) )
450
-			{ unset($this->attributes[$offset]); }
449
+		if( isset($this->attributes[ $offset ]) )
450
+			{ unset($this->attributes[ $offset ]); }
451 451
 	}
452 452
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -242,11 +242,11 @@
 block discarded – undo
242 242
 		return $this->setMultinameAttribute('link',$this->sectionLedBy('@',true),function( string$link ){
243 243
 			if( isset($this->config['target']) && ':'===$link{0} ){
244 244
 				return 'javascript'.$link;
245
-			}elseif( '//'===($firstTwoLetters=substr($link,0,2)) ){
245
+			} elseif( '//'===($firstTwoLetters=substr($link,0,2)) ){
246 246
 				return 'http:'.$link;
247
-			}elseif( '\\\\'===$firstTwoLetters ){
247
+			} elseif( '\\\\'===$firstTwoLetters ){
248 248
 				return 'https://'.substr($link,2);
249
-			}else{
249
+			} else{
250 250
 				return $this->checkExpression($link);
251 251
 			}
252 252
 		});
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	{
180 180
 		$params= preg_split('/(?<!\\\\)\\|/',$this->line->pregGet('/^-[\w-:]+\((.*?)\)(?= |(\\{>)?$)/',1));
181 181
 
182
-		if( ($m= count($params)) != ($n= count($this->config['params'])) ){$this->document->throw("Tag $this->name has $n parameters $m given.");}
182
+		if( ($m= count($params)) != ($n= count($this->config['params'])) ){$this->document->throw("tag $this->name has $n parameters $m given.");}
183 183
 
184 184
 		array_map(function( $key, $value ){return $this->setAttribute($key,$this->checkExpression(str_replace('\\|','|',$value)));},$this->config['params'],$params);
185 185
 
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 	protected function setAttribute( string$key, string$value, string$condition=null ):self
382 382
 	{
383 383
 		if( isset($this->attributes[$key]) )
384
-			{ $this->document->throw("Attribute $key of $this->name cannot redeclare."); }
384
+			{ $this->document->throw("attribute $key of $this->name cannot redeclare."); }
385 385
 
386 386
 		$this->attributes[$key]=[
387 387
 			'value'=> $value,
Please login to merge, or discard this patch.