Completed
Push — master ( 3021e9...64aadc )
by Fenz
02:37
created
libs/Helper/DefaultConfigs.php 1 patch
Spacing   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -170,66 +170,66 @@  discard block
 block discarded – undo
170 170
 				],
171 171
 			],
172 172
 			'tag_nodes'=> [
173
-				'SVG1.1'=> $svgTags= [
173
+				'SVG1.1'=> $svgTags=[
174 174
 					'svg'=> [
175 175
 						'out'=> [
176
-							'default_attributes'=> ['xmlns'=> 'http://www.w3.org/2000/svg','version'=> '1.1',],
177
-							'params'=> ['viewBox',],
176
+							'default_attributes'=> [ 'xmlns'=> 'http://www.w3.org/2000/svg', 'version'=> '1.1', ],
177
+							'params'=> [ 'viewBox', ],
178 178
 							'scope'=> 'svg',
179 179
 						],
180 180
 						'in'=> [
181 181
 							'svg'=> [
182
-								'params'=> ['x','y','width','height',],
182
+								'params'=> [ 'x', 'y', 'width', 'height', ],
183 183
 							],
184 184
 						],
185 185
 					],
186
-					'*'=> [],
186
+					'*'=> [ ],
187 187
 					'polygon'=> [
188
-						'params'=> ['points',],
189
-						'only_in'=> ['svg',],
188
+						'params'=> [ 'points', ],
189
+						'only_in'=> [ 'svg', ],
190 190
 					],
191 191
 					'polyline'=> [
192
-						'params'=> ['points',],
193
-						'only_in'=> ['svg',],
192
+						'params'=> [ 'points', ],
193
+						'only_in'=> [ 'svg', ],
194 194
 					],
195 195
 					'path'=> [
196
-						'params'=> ['d',],
197
-						'only_in'=> ['svg',],
196
+						'params'=> [ 'd', ],
197
+						'only_in'=> [ 'svg', ],
198 198
 					],
199 199
 					'line'=> [
200
-						'params'=> ['x1','y1','x2','y2',],
201
-						'only_in'=> ['svg',],
200
+						'params'=> [ 'x1', 'y1', 'x2', 'y2', ],
201
+						'only_in'=> [ 'svg', ],
202 202
 					],
203 203
 					'rect'=> [
204
-						'params'=> ['x','y','width','height',],
205
-						'only_in'=> ['svg',],
204
+						'params'=> [ 'x', 'y', 'width', 'height', ],
205
+						'only_in'=> [ 'svg', ],
206 206
 					],
207 207
 					'circle'=> [
208
-						'params'=> ['cx','cy','r',],
209
-						'only_in'=> ['svg',],
208
+						'params'=> [ 'cx', 'cy', 'r', ],
209
+						'only_in'=> [ 'svg', ],
210 210
 					],
211 211
 					'ellipse'=> [
212
-						'params'=> ['cx','cy','rx','ry',],
213
-						'only_in'=> ['svg',],
212
+						'params'=> [ 'cx', 'cy', 'rx', 'ry', ],
213
+						'only_in'=> [ 'svg', ],
214 214
 					],
215 215
 					'text'=> [
216
-						'params'=> ['x','y',],
217
-						'only_in'=> ['svg',],
216
+						'params'=> [ 'x', 'y', ],
217
+						'only_in'=> [ 'svg', ],
218 218
 					],
219 219
 				],
220 220
 				'HTML5'=> [
221
-					'*'=> [],
221
+					'*'=> [ ],
222 222
 					'charset'=> [
223 223
 						'name'=> 'meta',
224
-						'params'=> ['charset',],
224
+						'params'=> [ 'charset', ],
225 225
 					],
226 226
 					'equiv'=> [
227 227
 						'name'=> 'meta',
228
-						'name_value'=> ['http-equiv','content','scheme',],
228
+						'name_value'=> [ 'http-equiv', 'content', 'scheme', ],
229 229
 					],
230 230
 					'meta'=> [
231 231
 						'name'=> 'meta',
232
-						'name_value'=> ['name','content','scheme',],
232
+						'name_value'=> [ 'name', 'content', 'scheme', ],
233 233
 					],
234 234
 					'php'=> [
235 235
 						'opener'=> '<?php ',
@@ -241,14 +241,14 @@  discard block
 block discarded – undo
241 241
 						'multiple'=> [
242 242
 							[
243 243
 								'pattern'=> '/\{>$/',
244
-								'params'=> ['type',],
245
-								'default_attributes'=> ['codeset'=> 'codeset',],
244
+								'params'=> [ 'type', ],
245
+								'default_attributes'=> [ 'codeset'=> 'codeset', ],
246 246
 								'embedding'=> 'code',
247 247
 							],
248 248
 							[
249 249
 								'pattern'=> '/.?/',
250 250
 								'name'=> 'code',
251
-								'params'=> ['type',],
251
+								'params'=> [ 'type', ],
252 252
 							],
253 253
 						],
254 254
 					],
@@ -257,13 +257,13 @@  discard block
 block discarded – undo
257 257
 							[
258 258
 								'pattern'=> '/^-js @/',
259 259
 								'name'=> 'script',
260
-								'default_attributes'=> ['type'=> 'text/javascript',],
260
+								'default_attributes'=> [ 'type'=> 'text/javascript', ],
261 261
 								'link'=> 'src',
262 262
 							],
263 263
 							[
264 264
 								'pattern'=> '/^-js\{>/',
265 265
 								'name'=> 'script',
266
-								'default_attributes'=> ['type'=> 'text/javascript',],
266
+								'default_attributes'=> [ 'type'=> 'text/javascript', ],
267 267
 								'embedding'=> 'js',
268 268
 							],
269 269
 						],
@@ -273,90 +273,90 @@  discard block
 block discarded – undo
273 273
 							[
274 274
 								'pattern'=> '/^-css @/',
275 275
 								'name'=> 'link',
276
-								'default_attributes'=> ['rel'=> 'stylesheet','type'=> 'text/css',],
276
+								'default_attributes'=> [ 'rel'=> 'stylesheet', 'type'=> 'text/css', ],
277 277
 								'link'=> 'href',
278 278
 							],
279 279
 							[
280 280
 								'pattern'=> '/^-css\{>/',
281 281
 								'name'=> 'style',
282
-								'default_attributes'=> ['type'=> 'text/css',],
282
+								'default_attributes'=> [ 'type'=> 'text/css', ],
283 283
 								'embedding'=> 'css',
284 284
 							],
285 285
 						],
286 286
 					],
287 287
 					'icon'=> [
288 288
 						'name'=> 'link',
289
-						'default_attributes'=> ['rel'=> 'icon',],
290
-						'params'=> ['sizes',],
289
+						'default_attributes'=> [ 'rel'=> 'icon', ],
290
+						'params'=> [ 'sizes', ],
291 291
 						'link'=> 'href',
292 292
 					],
293 293
 					'shortcut'=> [
294 294
 						'name'=> 'link',
295
-						'default_attributes'=> ['rel'=> 'shortcut icon','type'=> 'image/x-icon',],
295
+						'default_attributes'=> [ 'rel'=> 'shortcut icon', 'type'=> 'image/x-icon', ],
296 296
 						'link'=> 'href',
297 297
 					],
298 298
 					'link'=> [
299 299
 						'name'=> 'link',
300
-						'params'=> ['rel',],
300
+						'params'=> [ 'rel', ],
301 301
 						'link'=> 'href',
302 302
 					],
303 303
 					'a'=> [
304 304
 						'link'=> 'href',
305
-						'name_value'=> ['name',],
305
+						'name_value'=> [ 'name', ],
306 306
 						'target'=> 'target',
307 307
 					],
308 308
 					'iframe'=> [
309 309
 						'link'=> 'src',
310
-						'default_attributes'=> ['frameborder'=> '0',],
311
-						'name_value'=> ['name',],
310
+						'default_attributes'=> [ 'frameborder'=> '0', ],
311
+						'name_value'=> [ 'name', ],
312 312
 					],
313 313
 					'img'=> [
314 314
 						'link'=> 'src',
315 315
 						'alt'=> 'alt',
316 316
 					],
317
-					'form'=>   ['name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> ['name',], 'default_attributes'=> ['method'=> 'post',],],
318
-					'post'=>   ['name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> ['name',], 'default_attributes'=> ['method'=> 'post',],],
319
-					'upload'=> ['name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> ['name',], 'default_attributes'=> ['method'=> 'post','enctype'=> 'multipart/form-data',],],
320
-					'get'=>    ['name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> ['name',], 'default_attributes'=> ['method'=> 'get',],],
317
+					'form'=>   [ 'name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> [ 'name', ], 'default_attributes'=> [ 'method'=> 'post', ], ],
318
+					'post'=>   [ 'name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> [ 'name', ], 'default_attributes'=> [ 'method'=> 'post', ], ],
319
+					'upload'=> [ 'name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> [ 'name', ], 'default_attributes'=> [ 'method'=> 'post', 'enctype'=> 'multipart/form-data', ], ],
320
+					'get'=>    [ 'name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> [ 'name', ], 'default_attributes'=> [ 'method'=> 'get', ], ],
321 321
 
322
-					'input'=>          ['name'=> 'input',  'default_attributes'=> ['type'=> 'hidden',],         'name_value'=> ['name', 'value', 'form',],],
323
-					'text'=>  ['out'=> ['name'=> 'input',  'default_attributes'=> ['type'=> 'text',],           'name_value'=> ['name', 'value', 'form',], 'alt'=> 'placeholder',], 'in'=> ['svg'=> ['params'=> ['x','y',],],],],
324
-					'search'=>         ['name'=> 'input',  'default_attributes'=> ['type'=> 'search',],         'name_value'=> ['name', 'value', 'form',], 'alt'=> 'placeholder',],
325
-					'password'=>       ['name'=> 'input',  'default_attributes'=> ['type'=> 'password',],       'name_value'=> ['name', 'value', 'form',], 'alt'=> 'placeholder',],
326
-					'email'=>          ['name'=> 'input',  'default_attributes'=> ['type'=> 'email',],          'name_value'=> ['name', 'value', 'form',], 'alt'=> 'placeholder',],
327
-					'url'=>            ['name'=> 'input',  'default_attributes'=> ['type'=> 'url',],            'name_value'=> ['name', 'value', 'form',], 'alt'=> 'placeholder',],
328
-					'tel'=>            ['name'=> 'input',  'default_attributes'=> ['type'=> 'tel',],            'name_value'=> ['name', 'value', 'form',], 'alt'=> 'placeholder',],
329
-					'number'=>         ['name'=> 'input',  'default_attributes'=> ['type'=> 'number',],         'name_value'=> ['name', 'value', 'form',], 'alt'=> 'placeholder', 'params'=> ['min', 'step', 'max',],],
330
-					'range'=>          ['name'=> 'input',  'default_attributes'=> ['type'=> 'range',],          'name_value'=> ['name', 'value', 'form',],                'params'=> ['min', 'step', 'max',],],
331
-					'radio'=>          ['name'=> 'input',  'default_attributes'=> ['type'=> 'radio',],          'name_value'=> ['name', 'value', 'form',],],
332
-					'checkbox'=>       ['name'=> 'input',  'default_attributes'=> ['type'=> 'checkbox',],       'name_value'=> ['name', 'value', 'form',],],
333
-					'date'=>           ['name'=> 'input',  'default_attributes'=> ['type'=> 'date',],           'name_value'=> ['name', 'value', 'form',],],
334
-					'month'=>          ['name'=> 'input',  'default_attributes'=> ['type'=> 'month',],          'name_value'=> ['name', 'value', 'form',],],
335
-					'week'=>           ['name'=> 'input',  'default_attributes'=> ['type'=> 'week',],           'name_value'=> ['name', 'value', 'form',],],
336
-					'time'=>           ['name'=> 'input',  'default_attributes'=> ['type'=> 'time',],           'name_value'=> ['name', 'value', 'form',],],
337
-					'datetime'=>       ['name'=> 'input',  'default_attributes'=> ['type'=> 'datetime',],       'name_value'=> ['name', 'value', 'form',],],
338
-					'datetime-local'=> ['name'=> 'input',  'default_attributes'=> ['type'=> 'datetime-local',], 'name_value'=> ['name', 'value', 'form',],],
339
-					'color'=>          ['name'=> 'input',  'default_attributes'=> ['type'=> 'color',],          'name_value'=> ['name', 'value', 'form',],],
340
-					'file'=>           ['name'=> 'input',  'default_attributes'=> ['type'=> 'file',],           'name_value'=> ['name', 'form',], 'params'=> ['accept',],],
322
+					'input'=>          [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'hidden', ], 'name_value'=> [ 'name', 'value', 'form', ], ],
323
+					'text'=>  [ 'out'=> [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'text', ], 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', ], 'in'=> [ 'svg'=> [ 'params'=> [ 'x', 'y', ], ], ], ],
324
+					'search'=>         [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'search', ], 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', ],
325
+					'password'=>       [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'password', ], 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', ],
326
+					'email'=>          [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'email', ], 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', ],
327
+					'url'=>            [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'url', ], 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', ],
328
+					'tel'=>            [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'tel', ], 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', ],
329
+					'number'=>         [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'number', ], 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', 'params'=> [ 'min', 'step', 'max', ], ],
330
+					'range'=>          [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'range', ], 'name_value'=> [ 'name', 'value', 'form', ], 'params'=> [ 'min', 'step', 'max', ], ],
331
+					'radio'=>          [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'radio', ], 'name_value'=> [ 'name', 'value', 'form', ], ],
332
+					'checkbox'=>       [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'checkbox', ], 'name_value'=> [ 'name', 'value', 'form', ], ],
333
+					'date'=>           [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'date', ], 'name_value'=> [ 'name', 'value', 'form', ], ],
334
+					'month'=>          [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'month', ], 'name_value'=> [ 'name', 'value', 'form', ], ],
335
+					'week'=>           [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'week', ], 'name_value'=> [ 'name', 'value', 'form', ], ],
336
+					'time'=>           [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'time', ], 'name_value'=> [ 'name', 'value', 'form', ], ],
337
+					'datetime'=>       [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'datetime', ], 'name_value'=> [ 'name', 'value', 'form', ], ],
338
+					'datetime-local'=> [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'datetime-local', ], 'name_value'=> [ 'name', 'value', 'form', ], ],
339
+					'color'=>          [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'color', ], 'name_value'=> [ 'name', 'value', 'form', ], ],
340
+					'file'=>           [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'file', ], 'name_value'=> [ 'name', 'form', ], 'params'=> [ 'accept', ], ],
341 341
 
342
-					'submit'=>         ['name'=> 'button', 'default_attributes'=> ['type'=> 'submit',],         'name_value'=> ['name', 'value','form',], 'link'=> 'formaction', 'target'=> 'formtarget',],
343
-					'reset'=>          ['name'=> 'button', 'default_attributes'=> ['type'=> 'reset',],          'name_value'=> ['form',],],
344
-					'button'=>         ['name'=> 'button', 'default_attributes'=> ['type'=> 'button',],],
342
+					'submit'=>         [ 'name'=> 'button', 'default_attributes'=> [ 'type'=> 'submit', ], 'name_value'=> [ 'name', 'value', 'form', ], 'link'=> 'formaction', 'target'=> 'formtarget', ],
343
+					'reset'=>          [ 'name'=> 'button', 'default_attributes'=> [ 'type'=> 'reset', ], 'name_value'=> [ 'form', ], ],
344
+					'button'=>         [ 'name'=> 'button', 'default_attributes'=> [ 'type'=> 'button', ], ],
345 345
 
346
-					'textarea'=>       ['name'=> 'textarea', 'name_value'=> ['name','value','form',],'alt'=> 'placeholder',],
346
+					'textarea'=>       [ 'name'=> 'textarea', 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', ],
347 347
 
348 348
 					'select'=> [
349
-						'name_value'=> ['name', 'value','form',],
349
+						'name_value'=> [ 'name', 'value', 'form', ],
350 350
 						'scope'=> 'select',
351 351
 					],
352 352
 					'datalist'=> [
353
-						'params'=> ['id',],
353
+						'params'=> [ 'id', ],
354 354
 						'scope'=> 'datalist',
355 355
 					],
356 356
 					'optgroup'=> [
357 357
 						'in'=> [
358 358
 							'select'=> [
359
-								'name_value'=> ['label',],
359
+								'name_value'=> [ 'label', ],
360 360
 							],
361 361
 						],
362 362
 					],
@@ -364,23 +364,23 @@  discard block
 block discarded – undo
364 364
 						'in'=> [
365 365
 							'select'=> [
366 366
 								'scope_function'=> function( $scope ){
367
-									if( $scope['value']===$this['value'] ){
368
-										$this['selected']= 'selected';
367
+									if( $scope[ 'value' ]===$this[ 'value' ] ){
368
+										$this[ 'selected' ]='selected';
369 369
 									};
370 370
 								},
371
-								'name_value'=> ['value', 'label',],
371
+								'name_value'=> [ 'value', 'label', ],
372 372
 							],
373 373
 							'datalist'=> [
374
-								'name_value'=> ['value',],
374
+								'name_value'=> [ 'value', ],
375 375
 							],
376 376
 						],
377 377
 					],
378 378
 
379 379
 					'param'=> [
380
-						'name_value'=> ['name','value',],
380
+						'name_value'=> [ 'name', 'value', ],
381 381
 					],
382 382
 					'source'=> [
383
-						'params'=>['type',],
383
+						'params'=>[ 'type', ],
384 384
 						'link'=> 'src',
385 385
 					],
386 386
 					'base'=> [
Please login to merge, or discard this patch.
libs/ReadingBuffer/Contracts/ABuffer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	 *
32 32
 	 * @var string
33 33
 	 */
34
-	protected $filePath= '';
34
+	protected $filePath='';
35 35
 
36 36
 	/**
37 37
 	 * Constructing a buffer reading HTSL content from somewhere.
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	 */
43 43
 	public function __construct( Htsl$htsl )
44 44
 	{
45
-		$this->htsl= $htsl;
45
+		$this->htsl=$htsl;
46 46
 	}
47 47
 
48 48
 	/**
Please login to merge, or discard this patch.
libs/Parser/Document.php 2 patches
Spacing   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	 *
91 91
 	 * @var int
92 92
 	 */
93
-	private $level= 0;
93
+	private $level=0;
94 94
 
95 95
 	/**
96 96
 	 * Section indent level.
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	 *
100 100
 	 * @var int
101 101
 	 */
102
-	private $sectionLevel= 0;
102
+	private $sectionLevel=0;
103 103
 
104 104
 	/**
105 105
 	 * Opened nodes.
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	 *
109 109
 	 * @var [ Htsl\Parser\Node\Contracts\ANode, ]
110 110
 	 */
111
-	private $openedNodes= [];
111
+	private $openedNodes=[ ];
112 112
 
113 113
 	/**
114 114
 	 * Current scopes.
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 *
118 118
 	 * @var [ Htsl\Parser\Node\Contracts\ANode, ]
119 119
 	 */
120
-	private $scopes= [];
120
+	private $scopes=[ ];
121 121
 
122 122
 	/**
123 123
 	 * Current line number.
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	 *
127 127
 	 * @var int
128 128
 	 */
129
-	private $lineNumber= 0;
129
+	private $lineNumber=0;
130 130
 
131 131
 	/**
132 132
 	 * Current line.
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 	 *
145 145
 	 * @var [ Htsl\Parser\Section, ]
146 146
 	 */
147
-	private $sections=[];
147
+	private $sections=[ ];
148 148
 
149 149
 	/**
150 150
 	 * Whether the document is executed.
@@ -184,13 +184,13 @@  discard block
 block discarded – undo
184 184
 	 */
185 185
 	public function __construct( Htsl$htsl, Buffer$buffer, self$parent=null )
186 186
 	{
187
-		$this->htsl= $htsl;
188
-		$this->buffer= $buffer;
187
+		$this->htsl=$htsl;
188
+		$this->buffer=$buffer;
189 189
 
190 190
 		if( $parent ){
191
-			$this->parent= $parent;
192
-			$this->docType= $parent->docType;
193
-			$this->indentation= $parent->indentation;
191
+			$this->parent=$parent;
192
+			$this->docType=$parent->docType;
193
+			$this->indentation=$parent->indentation;
194 194
 		}else{
195 195
 			$this->parseFirstLine();
196 196
 		}
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 	protected function getLine():Line
252 252
 	{
253 253
 		do{
254
-			$line= $this->buffer->getLine();
254
+			$line=$this->buffer->getLine();
255 255
 		}while( $line->isEmpty() && $line->hasMore() );
256 256
 
257 257
 		return $line;
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 	 */
269 269
 	public function getConfig( string...$keys )
270 270
 	{
271
-		return $this->htsl->getConfig(array_shift($keys),$this->docType,...$keys);
271
+		return $this->htsl->getConfig(array_shift($keys), $this->docType, ...$keys);
272 272
 	}
273 273
 
274 274
 	/**
@@ -316,16 +316,16 @@  discard block
 block discarded – undo
316 316
 	 */
317 317
 	protected function parseFirstLine():self
318 318
 	{
319
-		$line= $this->getLine();
319
+		$line=$this->getLine();
320 320
 
321 321
 		if( '@'===$line->getChar(0) ){
322 322
 			return $this->setExtending($line);
323 323
 		}
324 324
 
325
-		$this->docType= $line->content;
326
-		$docTypeContent= $this->getConfig('doc_types') or $this->throw("DocType $this->docType is not supported");
325
+		$this->docType=$line->content;
326
+		$docTypeContent=$this->getConfig('doc_types') or $this->throw("DocType $this->docType is not supported");
327 327
 
328
-		$this->indentation= $this->htsl->getConfig('indentation',$this->docType) ?? ( function( $scalarOrFalse ){ return is_scalar($scalarOrFalse)?$scalarOrFalse:false; } )($this->htsl->getConfig('indentation'));
328
+		$this->indentation=$this->htsl->getConfig('indentation', $this->docType) ?? (function( $scalarOrFalse ){ return is_scalar($scalarOrFalse)? $scalarOrFalse : false; } )($this->htsl->getConfig('indentation'));
329 329
 
330 330
 		$this->appendLine($docTypeContent);
331 331
 
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 	 */
344 344
 	protected function setExtending( Line$firstLine ):self
345 345
 	{
346
-		switch( $name= $firstLine->pregGet('/(?<=^@)[\w-:]+/') ){
346
+		switch( $name=$firstLine->pregGet('/(?<=^@)[\w-:]+/') ){
347 347
 			default:{
348 348
 				$this->throw("The @$name is not supported.");
349 349
 			}break;
@@ -369,8 +369,8 @@  discard block
 block discarded – undo
369 369
 	 */
370 370
 	protected function lineByLine():self
371 371
 	{
372
-		while( ($line= $this->getLine())->hasMore() ){
373
-			$this->lineNumber+= 1;
372
+		while( ($line=$this->getLine())->hasMore() ){
373
+			$this->lineNumber+=1;
374 374
 
375 375
 			if( $this->embedment ){
376 376
 				$this->embeddingParse($line);
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 
384 384
 		$this->closeNodes($this->level);
385 385
 
386
-		$this->isExecuted= true;
386
+		$this->isExecuted=true;
387 387
 
388 388
 		return $this;
389 389
 	}
@@ -418,10 +418,10 @@  discard block
 block discarded – undo
418 418
 	 */
419 419
 	protected function startEmbedding( string$embedType ):self
420 420
 	{
421
-		$embedmentClass= '\\Htsl\\Embedment\\'.ucfirst($embedType).'Embedment';
421
+		$embedmentClass='\\Htsl\\Embedment\\'.ucfirst($embedType).'Embedment';
422 422
 		class_exists($embedmentClass) or $this->throw("Embed type $embedType not exists.");
423 423
 
424
-		$this->embedment= new $embedmentClass($this);
424
+		$this->embedment=new $embedmentClass($this);
425 425
 
426 426
 		return $this;
427 427
 	}
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 	public function breakEmbedding():self
437 437
 	{
438 438
 		$this->append($this->embedment->getContent());
439
-		$this->embedment= null;
439
+		$this->embedment=null;
440 440
 
441 441
 		return $this;
442 442
 	}
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 	 */
453 453
 	protected function parseLine( Line$line ):self
454 454
 	{
455
-		$this->currentLine= $line;
455
+		$this->currentLine=$line;
456 456
 		$this->setLevel($line->getIndentLevel());
457 457
 
458 458
 		$this->{'parse'.ucfirst($this->getLineType($line))}($line);
@@ -471,10 +471,10 @@  discard block
 block discarded – undo
471 471
 	 */
472 472
 	protected function getLineType( Line$line ):string
473 473
 	{
474
-		$possibleType= self::POSSIBLE_LINE_TYPES;
474
+		$possibleType=self::POSSIBLE_LINE_TYPES;
475 475
 
476 476
 		for( $i=0; is_array($possibleType); ++$i ){
477
-			$possibleType= $possibleType[$line->getChar($i)]??$possibleType[' '];
477
+			$possibleType=$possibleType[ $line->getChar($i) ]??$possibleType[ ' ' ];
478 478
 		}
479 479
 
480 480
 		return $possibleType;
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
 	 *
490 490
 	 * @todo Make this const private when php 7.1
491 491
 	 */
492
-	const POSSIBLE_LINE_TYPES= [
492
+	const POSSIBLE_LINE_TYPES=[
493 493
 		'`'=> [
494 494
 			'='=> 'expressionHtmlLine',
495 495
 			' '=> 'htmlLine',
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 	 */
514 514
 	protected function parseHtmlLine( Line$line ):self
515 515
 	{
516
-		$node= new StringNode($this,$line);
516
+		$node=new StringNode($this, $line);
517 517
 
518 518
 		$this->openNode($node);
519 519
 
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
 	 */
534 534
 	protected function parseStringLine( Line$line ):self
535 535
 	{
536
-		$node= new StringNode($this,$line);
536
+		$node=new StringNode($this, $line);
537 537
 
538 538
 		$this->openNode($node);
539 539
 
@@ -553,13 +553,13 @@  discard block
 block discarded – undo
553 553
 	 */
554 554
 	protected function parseExpressionLine( Line$line ):self
555 555
 	{
556
-		$node= new StringNode($this,$line);
556
+		$node=new StringNode($this, $line);
557 557
 
558 558
 		$this->openNode($node);
559 559
 
560
-		$content=  $line->slice(1);
561
-		$ent_flag= var_export($this->htsl->getConfig('ENT_flags',$this->docType),true);
562
-		$charset=   var_export($this->htsl->getConfig('charset'),true);
560
+		$content=$line->slice(1);
561
+		$ent_flag=var_export($this->htsl->getConfig('ENT_flags', $this->docType), true);
562
+		$charset=var_export($this->htsl->getConfig('charset'), true);
563 563
 
564 564
 		$this->appendLine("<?=htmlentities($content,$ent_flag,$charset,false)?>");
565 565
 
@@ -577,11 +577,11 @@  discard block
 block discarded – undo
577 577
 	 */
578 578
 	protected function parseExpressionHtmlLine( Line$line ):self
579 579
 	{
580
-		$node= new StringNode($this,$line);
580
+		$node=new StringNode($this, $line);
581 581
 
582 582
 		$this->openNode($node);
583 583
 
584
-		$content=  $line->slice(1);
584
+		$content=$line->slice(1);
585 585
 
586 586
 		$this->appendLine("<?$content?>");
587 587
 
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
 	 */
600 600
 	protected function parseCommentLine( Line$line ):self
601 601
 	{
602
-		$node= new CommentNode($this,$line);
602
+		$node=new CommentNode($this, $line);
603 603
 
604 604
 		$this->openNode($node);
605 605
 
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
 	 */
620 620
 	protected function parseTagLine( Line$line ):self
621 621
 	{
622
-		$tag= new TagNode($this,$line);
622
+		$tag=new TagNode($this, $line);
623 623
 
624 624
 		$this->appendLine($tag->open());
625 625
 
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
 	 */
642 642
 	protected function parseControlLine( Line$line ):self
643 643
 	{
644
-		$controlStructure= new ControlNode($this,$line);
644
+		$controlStructure=new ControlNode($this, $line);
645 645
 
646 646
 		$this->appendLine($controlStructure->open());
647 647
 
@@ -661,7 +661,7 @@  discard block
 block discarded – undo
661 661
 	 */
662 662
 	protected function parseDocControlLine( Line$line ):self
663 663
 	{
664
-		switch( $name= $line->pregGet('/(?<=^@)[\w-:]+/') ){
664
+		switch( $name=$line->pregGet('/(?<=^@)[\w-:]+/') ){
665 665
 			default:{
666 666
 				$this->throw("The @$name is not supported.");
667 667
 			}break;
@@ -693,10 +693,10 @@  discard block
 block discarded – undo
693 693
 	 */
694 694
 	protected function extend( string$fileName ):self
695 695
 	{
696
-		$this->parent= new static($this->htsl,$this->buffer->goSide($fileName));
696
+		$this->parent=new static($this->htsl, $this->buffer->goSide($fileName));
697 697
 
698
-		$this->docType= $this->parent->docType;
699
-		$this->indentation= $this->parent->indentation;
698
+		$this->docType=$this->parent->docType;
699
+		$this->indentation=$this->parent->indentation;
700 700
 
701 701
 		return $this;
702 702
 	}
@@ -710,15 +710,15 @@  discard block
 block discarded – undo
710 710
 	 *
711 711
 	 * @return \Htsl\Parser\Document
712 712
 	 */
713
-	protected function include( Line$line ):self
713
+	protected function include(Line$line):self
714 714
 	{
715
-		$inclued= (new static($this->htsl,$this->buffer->goSide($line->pregGet('/(?<=\( ).*(?= \))/')),$this))->execute()->content;
715
+		$inclued=(new static($this->htsl, $this->buffer->goSide($line->pregGet('/(?<=\( ).*(?= \))/')), $this))->execute()->content;
716 716
 
717 717
 		if( false!==$this->indentation ){
718
-			$inclued= preg_replace('/(?<=^|\\n)(?!$)/',str_repeat($this->indentation,$this->level-$this->sectionLevel),$inclued);
718
+			$inclued=preg_replace('/(?<=^|\\n)(?!$)/', str_repeat($this->indentation, $this->level-$this->sectionLevel), $inclued);
719 719
 		}
720 720
 
721
-		$node= new StringNode($this,$line);
721
+		$node=new StringNode($this, $line);
722 722
 
723 723
 		$this->openNode($node);
724 724
 
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
 	 */
739 739
 	protected function defineSection( Line$line ):self
740 740
 	{
741
-		$node= new SectionNode($this,$line);
741
+		$node=new SectionNode($this, $line);
742 742
 
743 743
 		$node->open();
744 744
 
@@ -758,22 +758,22 @@  discard block
 block discarded – undo
758 758
 	 */
759 759
 	protected function showSection( Line$line ):self
760 760
 	{
761
-		$sectionName= $line->pregGet('/(?<=\( ).*(?= \))/');
761
+		$sectionName=$line->pregGet('/(?<=\( ).*(?= \))/');
762 762
 
763
-		if( !isset($this->sections[$sectionName]) ){
764
-			$this->openNode(new StringNode($this,$line));
763
+		if( !isset($this->sections[ $sectionName ]) ){
764
+			$this->openNode(new StringNode($this, $line));
765 765
 
766 766
 			return $this;
767 767
 		}
768
-		$content= $this->sections[$sectionName]->content;
768
+		$content=$this->sections[ $sectionName ]->content;
769 769
 
770 770
 		if( false!==$this->indentation ){
771
-			$content= preg_replace('/(?<=^|\\n)(?!$)/',str_repeat($this->indentation,$this->level),$content);
771
+			$content=preg_replace('/(?<=^|\\n)(?!$)/', str_repeat($this->indentation, $this->level), $content);
772 772
 		}
773 773
 
774 774
 		$this->append($content);
775 775
 
776
-		$node= new NamelessSectionNode($this,$line);
776
+		$node=new NamelessSectionNode($this, $line);
777 777
 
778 778
 		$node->open();
779 779
 
@@ -792,8 +792,8 @@  discard block
 block discarded – undo
792 792
 	public function setSection( Section$section=null ):self
793 793
 	{
794 794
 		if( !$section ){
795
-			$this->sectionLevel= 0;
796
-			$this->currentSection= null;
795
+			$this->sectionLevel=0;
796
+			$this->currentSection=null;
797 797
 
798 798
 			return $this;
799 799
 		}
@@ -802,17 +802,17 @@  discard block
 block discarded – undo
802 802
 			$this->throw('Nesting definition of section is forbidden.');
803 803
 		}
804 804
 
805
-		if( isset($this->parent->sections[$section->name]) ){
805
+		if( isset($this->parent->sections[ $section->name ]) ){
806 806
 			$this->throw("Section {$section->name} already defined.");
807 807
 		}
808 808
 
809
-		$this->currentSection= $section;
809
+		$this->currentSection=$section;
810 810
 
811 811
 		if( $section->name ){
812
-			$this->parent->sections[$section->name]=$section;
812
+			$this->parent->sections[ $section->name ]=$section;
813 813
 		}
814 814
 
815
-		$this->sectionLevel= $this->level+1;
815
+		$this->sectionLevel=$this->level+1;
816 816
 
817 817
 		return $this;
818 818
 	}
@@ -828,8 +828,8 @@  discard block
 block discarded – undo
828 828
 	{
829 829
 		if( $this->parent ){
830 830
 			foreach( $this->sections as $name=>$section ){
831
-				if( !isset($this->parent->sections[$name]) ){
832
-					$this->parent->sections[$name]=$section;
831
+				if( !isset($this->parent->sections[ $name ]) ){
832
+					$this->parent->sections[ $name ]=$section;
833 833
 				};
834 834
 			}
835 835
 		}
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
 	 */
849 849
 	public function htmlEntities( string$input ):string
850 850
 	{
851
-		return htmlentities($input,$this->htsl->getConfig('ENT_flags',$this->docType),$this->htsl->getConfig('charset'),false);
851
+		return htmlentities($input, $this->htsl->getConfig('ENT_flags', $this->docType), $this->htsl->getConfig('charset'), false);
852 852
 	}
853 853
 
854 854
 	/**
@@ -860,12 +860,12 @@  discard block
 block discarded – undo
860 860
 	 */
861 861
 	protected function setLevel( int$level ):self
862 862
 	{
863
-		$level-= $this->level;
863
+		$level-=$this->level;
864 864
 
865 865
 		if( $level<=0 ){
866 866
 			$this->closeNodes(-$level);
867 867
 		}elseif( $level==1 ){
868
-			$this->level+= 1;
868
+			$this->level+=1;
869 869
 		}else{
870 870
 			$this->throw('Indent error.');
871 871
 		}
@@ -884,7 +884,7 @@  discard block
 block discarded – undo
884 884
 	 */
885 885
 	protected function openNode( Node$node ):self
886 886
 	{
887
-		array_push($this->openedNodes,$node);
887
+		array_push($this->openedNodes, $node);
888 888
 
889 889
 		$node->scope and $this->setScope($node);
890 890
 
@@ -905,13 +905,13 @@  discard block
 block discarded – undo
905 905
 		if( empty($this->openedNodes) ) return $this;
906 906
 
907 907
 		while( $level-->=0 ){
908
-			$node= array_pop($this->openedNodes);
908
+			$node=array_pop($this->openedNodes);
909 909
 
910 910
 			$node->scope and $this->removeScope($node);
911 911
 
912 912
 			$closer=$node->close($this->currentLine) and $this->appendLine($closer);
913 913
 
914
-			$this->level-= $level>=0 ?1:0;
914
+			$this->level-=$level>=0? 1 : 0;
915 915
 		}
916 916
 
917 917
 		return $this;
@@ -926,7 +926,7 @@  discard block
 block discarded – undo
926 926
 	 */
927 927
 	protected function setScope( Node$scope ):int
928 928
 	{
929
-		return array_unshift($this->scopes,$scope);
929
+		return array_unshift($this->scopes, $scope);
930 930
 	}
931 931
 
932 932
 	/**
@@ -938,7 +938,7 @@  discard block
 block discarded – undo
938 938
 	 */
939 939
 	public function getScope()
940 940
 	{
941
-		return $this->scopes[0]??null;
941
+		return $this->scopes[ 0 ]??null;
942 942
 	}
943 943
 
944 944
 	/**
@@ -971,7 +971,7 @@  discard block
 block discarded – undo
971 971
 	protected function appendLine( string$content ):self
972 972
 	{
973 973
 		if( false!==$this->indentation ){
974
-			$content= str_repeat($this->indentation,$this->level-$this->sectionLevel).$content."\n";
974
+			$content=str_repeat($this->indentation, $this->level-$this->sectionLevel).$content."\n";
975 975
 		}
976 976
 
977 977
 		return $this->append($content);
@@ -1018,7 +1018,7 @@  discard block
 block discarded – undo
1018 1018
 	 *
1019 1019
 	 * @throw \Htsl\Parser\HtslParsingException
1020 1020
 	 */
1021
-	public function throw( string$message )
1021
+	public function throw(string$message)
1022 1022
 	{
1023 1023
 		throw new HtslParsingException("$message at file {$this->buffer->fileName} line $this->lineNumber");
1024 1024
 	}
Please login to merge, or discard this patch.
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 			$this->parent= $parent;
192 192
 			$this->docType= $parent->docType;
193 193
 			$this->indentation= $parent->indentation;
194
-		}else{
194
+		} else{
195 195
 			$this->parseFirstLine();
196 196
 		}
197 197
 	}
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 	{
237 237
 		if( $this->parent ){
238 238
 			return $this->execute()->parent->getContent();
239
-		}else{
239
+		} else{
240 240
 			return $this->execute()->content;
241 241
 		}
242 242
 	}
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 
375 375
 			if( $this->embedment ){
376 376
 				$this->embeddingParse($line);
377
-			}else{
377
+			} else{
378 378
 				$this->parseLine($line);
379 379
 			}
380 380
 		}
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 	{
402 402
 		if( $line->content==='<}' ){
403 403
 			$this->breakEmbedding();
404
-		}else{
404
+		} else{
405 405
 			$this->embedment->parseLine($line->getSubIndentLine());
406 406
 		}
407 407
 		return $this;
@@ -864,9 +864,9 @@  discard block
 block discarded – undo
864 864
 
865 865
 		if( $level<=0 ){
866 866
 			$this->closeNodes(-$level);
867
-		}elseif( $level==1 ){
867
+		} elseif( $level==1 ){
868 868
 			$this->level+= 1;
869
-		}else{
869
+		} else{
870 870
 			$this->throw('Indent error.');
871 871
 		}
872 872
 
@@ -902,7 +902,9 @@  discard block
 block discarded – undo
902 902
 	 */
903 903
 	protected function closeNodes( int$level=0 ):self
904 904
 	{
905
-		if( empty($this->openedNodes) ) return $this;
905
+		if( empty($this->openedNodes) ){
906
+			return $this;
907
+		}
906 908
 
907 909
 		while( $level-->=0 ){
908 910
 			$node= array_pop($this->openedNodes);
@@ -990,7 +992,7 @@  discard block
 block discarded – undo
990 992
 	{
991 993
 		if( $this->currentSection ){
992 994
 			$this->currentSection->append($content);
993
-		}else{
995
+		} else{
994 996
 			$this->content.=$content;
995 997
 		}
996 998
 
Please login to merge, or discard this patch.