Completed
Branch master (e75327)
by Fenz
07:29
created
libs/Embedment/CodeEmbedment.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 	 *
15 15
 	 * @param  \Htsl\ReadingBuffer\Line $line
16 16
 	 *
17
-	 * @return \Htsl\Embedment\Contracts
17
+	 * @return CodeEmbedment
18 18
 	 */
19 19
 	public function parseLine( Line$line ):parent
20 20
 	{
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,13 +18,13 @@
 block discarded – undo
18 18
 	 */
19 19
 	public function parseLine( Line$line ):parent
20 20
 	{
21
-		$content= '<code>'.htmlentities($line->fullContent).'</code>';
21
+		$content='<code>'.htmlentities($line->fullContent).'</code>';
22 22
 
23
-		$indentation= $this->document->indentation;
23
+		$indentation=$this->document->indentation;
24 24
 
25
-		false!==$indentation and $content= str_repeat($indentation,$this->document->indentLevel).$content."\n";
25
+		false!==$indentation and $content=str_repeat($indentation, $this->document->indentLevel).$content."\n";
26 26
 
27
-		$this->content.= $content;
27
+		$this->content.=$content;
28 28
 
29 29
 		return $this;
30 30
 	}
Please login to merge, or discard this patch.
libs/Embedment/CssEmbedment.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 	 *
15 15
 	 * @param  \Htsl\ReadingBuffer\Line $line
16 16
 	 *
17
-	 * @return \Htsl\Embedment\Contracts
17
+	 * @return CssEmbedment
18 18
 	 */
19 19
 	public function parseLine( Line$line ):parent
20 20
 	{
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 	 */
19 19
 	public function parseLine( Line$line ):parent
20 20
 	{
21
-		$this->content.= $line->content;
21
+		$this->content.=$line->content;
22 22
 		return $this;
23 23
 	}
24 24
 }
Please login to merge, or discard this patch.
libs/Embedment/JsEmbedment.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 	 *
23 23
 	 * @param  \Htsl\ReadingBuffer\Line $line
24 24
 	 *
25
-	 * @return \Htsl\Embedment\Contracts
25
+	 * @return JsEmbedment
26 26
 	 */
27 27
 	public function parseLine( Line$line ):parent
28 28
 	{
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 	 */
27 27
 	public function parseLine( Line$line ):parent
28 28
 	{
29
-		$this->content.= $line->fullContent."\n";
29
+		$this->content.=$line->fullContent."\n";
30 30
 		return $this;
31 31
 	}
32 32
 }
Please login to merge, or discard this patch.
libs/Embedment/PhpEmbedment.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 	 *
15 15
 	 * @param  \Htsl\ReadingBuffer\Line $line
16 16
 	 *
17
-	 * @return \Htsl\Embedment\Contracts
17
+	 * @return PhpEmbedment
18 18
 	 */
19 19
 	public function parseLine( Line$line ):parent
20 20
 	{
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 	 */
19 19
 	public function parseLine( Line$line ):parent
20 20
 	{
21
-		$this->content.= $line->content;
21
+		$this->content.=$line->content;
22 22
 		return $this;
23 23
 	}
24 24
 }
Please login to merge, or discard this patch.
libs/Embedment/TextEmbedment.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 	 *
15 15
 	 * @param  \Htsl\ReadingBuffer\Line $line
16 16
 	 *
17
-	 * @return \Htsl\Embedment\Contracts
17
+	 * @return TextEmbedment
18 18
 	 */
19 19
 	public function parseLine( Line$line ):parent
20 20
 	{
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 	 */
19 19
 	public function parseLine( Line$line ):parent
20 20
 	{
21
-		$this->content.= $line->fullContent."\n";
21
+		$this->content.=$line->fullContent."\n";
22 22
 		return $this;
23 23
 	}
24 24
 }
Please login to merge, or discard this patch.
libs/Htsl.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@
 block discarded – undo
123 123
 	/**
124 124
 	 * Getting the config of Htsl.
125 125
 	 *
126
-	 * @param  string $key
126
+	 * @param  string $keys
127 127
 	 *
128 128
 	 * @return mixed
129 129
 	 */
Please login to merge, or discard this patch.
Braces   +5 added lines, -8 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
 		if( $toFile ){
69 69
 			return file_put_contents($toFile,$result);
70
-		}else{
70
+		} else{
71 71
 			return $result;
72 72
 		}
73 73
 	}
@@ -159,15 +159,12 @@  discard block
 block discarded – undo
159 159
 
160 160
 		if( '/'===$filePath{0} ){
161 161
 			if( is_null($path) )
162
-				{ return $filePath; }
163
-			else
162
+				{ return $filePath; } else
164 163
 				{ return $this->basePath.$filePath; }
165
-		}else{
164
+		} else{
166 165
 			if( !strlen($path) )
167
-				{ return $this->basePath.'/'.$filePath; }
168
-			elseif( '/'===substr($path,-1) )
169
-				{ return $path.$filePath; }
170
-			else
166
+				{ return $this->basePath.'/'.$filePath; } elseif( '/'===substr($path,-1) )
167
+				{ return $path.$filePath; } else
171 168
 				{ return $path.'/'.$filePath; }
172 169
 		}
173 170
 
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
 	 *
35 35
 	 * @param array $config
36 36
 	 */
37
-	public function __construct( array$config=[] )
37
+	public function __construct( array$config=[ ] )
38 38
 	{
39
-		$this->config= array_replace_recursive($this->getDefaultConfigs(),$config);
39
+		$this->config=array_replace_recursive($this->getDefaultConfigs(), $config);
40 40
 	}
41 41
 
42 42
 	/**
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	 */
49 49
 	public function parse( string$content ):string
50 50
 	{
51
-		return $this->execute(new StringBuffer($this,$content));
51
+		return $this->execute(new StringBuffer($this, $content));
52 52
 	}
53 53
 
54 54
 	/**
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
 	 */
62 62
 	public function compile( string$fromFile, string$toFile=null )
63 63
 	{
64
-		$fromFile= $this->getFilePath($fromFile);
64
+		$fromFile=$this->getFilePath($fromFile);
65 65
 
66
-		$result= $this->execute(new FileBuffer($this,$fromFile));
66
+		$result=$this->execute(new FileBuffer($this, $fromFile));
67 67
 
68 68
 		if( $toFile ){
69
-			return file_put_contents($toFile,$result);
69
+			return file_put_contents($toFile, $result);
70 70
 		}else{
71 71
 			return $result;
72 72
 		}
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	 */
94 94
 	public function setBasePath( string$basePath ):self
95 95
 	{
96
-		$this->basePath= '/'===substr($basePath,-1) ? substr($basePath,0,-1) : $basePath;
96
+		$this->basePath='/'===substr($basePath, -1)? substr($basePath, 0, -1) : $basePath;
97 97
 
98 98
 		return $this;
99 99
 	}
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 */
118 118
 	protected function execute( ABuffer$buffer ):string
119 119
 	{
120
-		return (new Document($this,$buffer))->content;
120
+		return (new Document($this, $buffer))->content;
121 121
 	}
122 122
 
123 123
 	/**
@@ -129,13 +129,13 @@  discard block
 block discarded – undo
129 129
 	 */
130 130
 	public function getConfig( string...$keys )
131 131
 	{
132
-		$result= $this->config;
132
+		$result=$this->config;
133 133
 
134 134
 		foreach( $keys as $key ){
135
-			if( !isset($result[$key]) )
135
+			if( !isset($result[ $key ]) )
136 136
 				{ return null; }
137 137
 
138
-			$result= $result[$key];
138
+			$result=$result[ $key ];
139 139
 		}
140 140
 
141 141
 		return $result;
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 		}else{
166 166
 			if( !strlen($path) )
167 167
 				{ return $this->basePath.'/'.$filePath; }
168
-			elseif( '/'===substr($path,-1) )
168
+			elseif( '/'===substr($path, -1) )
169 169
 				{ return $path.$filePath; }
170 170
 			else
171 171
 				{ return $path.'/'.$filePath; }
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 	 */
182 182
 	public function getFileContent( string$filePath ):string
183 183
 	{
184
-		return isset($this->fileGetter) ? $this->fileGetter($filePath) : file_get_contents($filePath);
184
+		return isset($this->fileGetter)? $this->fileGetter($filePath) : file_get_contents($filePath);
185 185
 	}
186 186
 
187 187
 	/**
Please login to merge, or discard this patch.
libs/Parser/Document.php 5 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 	/**
173 173
 	 * Alias of getContent.
174 174
 	 *
175
-	 * @return sting
175
+	 * @return string
176 176
 	 */
177 177
 	public function __toString():string
178 178
 	{
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 	 * Getting the config of type of this document.
212 212
 	 *
213 213
 	 * @param  [ string, ] ...$keys
214
-	 * @return mixed
214
+	 * @return string
215 215
 	 */
216 216
 	public function getConfig( string...$keys )
217 217
 	{
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@
 block discarded – undo
165 165
 			return $this;
166 166
 		}
167 167
 		return $this->lineByLine()
168
-		            ->bubbleSections()
168
+					->bubbleSections()
169 169
 		;
170 170
 	}
171 171
 
Please login to merge, or discard this patch.
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -68,35 +68,35 @@  discard block
 block discarded – undo
68 68
 	 *
69 69
 	 * @var int
70 70
 	 */
71
-	private $level= 0;
71
+	private $level=0;
72 72
 
73 73
 	/**
74 74
 	 * Section indent level.
75 75
 	 *
76 76
 	 * @var int
77 77
 	 */
78
-	private $sectionLevel= 0;
78
+	private $sectionLevel=0;
79 79
 
80 80
 	/**
81 81
 	 * Opened nodes.
82 82
 	 *
83 83
 	 * @var [ Htsl\Parser\Node\Contracts\ANode, ]
84 84
 	 */
85
-	private $openedNodes= [];
85
+	private $openedNodes=[ ];
86 86
 
87 87
 	/**
88 88
 	 * Current scopes.
89 89
 	 *
90 90
 	 * @var [ Htsl\Parser\Node\Contracts\ANode, ]
91 91
 	 */
92
-	private $scopes= [];
92
+	private $scopes=[ ];
93 93
 
94 94
 	/**
95 95
 	 * Current line number.
96 96
 	 *
97 97
 	 * @var int
98 98
 	 */
99
-	private $lineNumber= 0;
99
+	private $lineNumber=0;
100 100
 
101 101
 	/**
102 102
 	 * Current line.
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 	 *
111 111
 	 * @var [ Htsl\Parser\Section, ]
112 112
 	 */
113
-	private $sections=[];
113
+	private $sections=[ ];
114 114
 
115 115
 	/**
116 116
 	 * Whether the document is executed.
@@ -142,13 +142,13 @@  discard block
 block discarded – undo
142 142
 	 */
143 143
 	public function __construct( Htsl$htsl, Buffer$buffer, self$parent=null )
144 144
 	{
145
-		$this->htsl= $htsl;
146
-		$this->buffer= $buffer;
145
+		$this->htsl=$htsl;
146
+		$this->buffer=$buffer;
147 147
 
148 148
 		if( $parent ){
149
-			$this->parent= $parent;
150
-			$this->docType= $parent->docType;
151
-			$this->indentation= $parent->indentation;
149
+			$this->parent=$parent;
150
+			$this->docType=$parent->docType;
151
+			$this->indentation=$parent->indentation;
152 152
 		}else{
153 153
 			$this->parseFirstLine();
154 154
 		}
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 	protected function getLine():Line
202 202
 	{
203 203
 		do{
204
-			$line= $this->buffer->getLine();
204
+			$line=$this->buffer->getLine();
205 205
 		}while( $line->isEmpty() && $line->hasMore() );
206 206
 
207 207
 		return $line;
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 	 */
216 216
 	public function getConfig( string...$keys )
217 217
 	{
218
-		return $this->htsl->getConfig(array_shift($keys),$this->docType,...$keys);
218
+		return $this->htsl->getConfig(array_shift($keys), $this->docType, ...$keys);
219 219
 	}
220 220
 
221 221
 	/**
@@ -255,16 +255,16 @@  discard block
 block discarded – undo
255 255
 	 */
256 256
 	protected function parseFirstLine():self
257 257
 	{
258
-		$line= $this->getLine();
258
+		$line=$this->getLine();
259 259
 
260 260
 		if( '@'===$line->getChar(0) ){
261 261
 			return $this->setExtending($line);
262 262
 		}
263 263
 
264
-		$this->docType= $line->content;
265
-		$docTypeContent= $this->getConfig('doc_types') or $this->throw("DocType $this->docType is not supported");
264
+		$this->docType=$line->content;
265
+		$docTypeContent=$this->getConfig('doc_types') or $this->throw("DocType $this->docType is not supported");
266 266
 
267
-		$this->indentation= $this->htsl->getConfig('indentation',$this->docType) ?? ( function( $scalarOrFalse ){ return is_scalar($scalarOrFalse)?$scalarOrFalse:false; } )($this->htsl->getConfig('indentation'));
267
+		$this->indentation=$this->htsl->getConfig('indentation', $this->docType) ?? (function( $scalarOrFalse ){ return is_scalar($scalarOrFalse)? $scalarOrFalse : false; } )($this->htsl->getConfig('indentation'));
268 268
 
269 269
 		$this->appendLine($docTypeContent);
270 270
 
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 	 */
279 279
 	protected function setExtending( Line$firstLine ):self
280 280
 	{
281
-		switch( $name= $firstLine->pregGet('/(?<=^@)[\w-:]+/') ){
281
+		switch( $name=$firstLine->pregGet('/(?<=^@)[\w-:]+/') ){
282 282
 			default:{
283 283
 				$this->throw("The @$name is not supported.");
284 284
 			}break;
@@ -302,8 +302,8 @@  discard block
 block discarded – undo
302 302
 	 */
303 303
 	protected function lineByLine():self
304 304
 	{
305
-		while( ($line= $this->getLine())->hasMore() ){
306
-			$this->lineNumber+= 1;
305
+		while( ($line=$this->getLine())->hasMore() ){
306
+			$this->lineNumber+=1;
307 307
 
308 308
 			if( $this->embedment ){
309 309
 				$this->embeddingParse($line);
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 
317 317
 		$this->closeNodes($this->level);
318 318
 
319
-		$this->isExecuted= true;
319
+		$this->isExecuted=true;
320 320
 
321 321
 		return $this;
322 322
 	}
@@ -347,10 +347,10 @@  discard block
 block discarded – undo
347 347
 	 */
348 348
 	protected function startEmbedding( string$embedType ):self
349 349
 	{
350
-		$embedmentClass= '\\Htsl\\Embedment\\'.ucfirst($embedType).'Embedment';
350
+		$embedmentClass='\\Htsl\\Embedment\\'.ucfirst($embedType).'Embedment';
351 351
 		class_exists($embedmentClass) or $this->throw("Embed type $embedType not exists.");
352 352
 
353
-		$this->embedment= new $embedmentClass($this);
353
+		$this->embedment=new $embedmentClass($this);
354 354
 
355 355
 		return $this;
356 356
 	}
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 	public function breakEmbedding():self
364 364
 	{
365 365
 		$this->append($this->embedment->getContent());
366
-		$this->embedment= null;
366
+		$this->embedment=null;
367 367
 
368 368
 		return $this;
369 369
 	}
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 	 */
378 378
 	protected function parseLine( Line$line ):self
379 379
 	{
380
-		$this->currentLine= $line;
380
+		$this->currentLine=$line;
381 381
 		$this->setLevel($line->getIndentLevel());
382 382
 
383 383
 		switch( $line->getChar(0) ){
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 	 */
419 419
 	protected function parseHtmlLine( Line$line ):self
420 420
 	{
421
-		$node= new StringNode($this,$line);
421
+		$node=new StringNode($this, $line);
422 422
 
423 423
 		$this->openNode($node);
424 424
 
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 	 */
437 437
 	protected function parseStringLine( Line$line ):self
438 438
 	{
439
-		$node= new StringNode($this,$line);
439
+		$node=new StringNode($this, $line);
440 440
 
441 441
 		$this->openNode($node);
442 442
 
@@ -454,12 +454,12 @@  discard block
 block discarded – undo
454 454
 	 */
455 455
 	protected function parseExpressionLine( Line$line ):self
456 456
 	{
457
-		$node= new StringNode($this,$line);
457
+		$node=new StringNode($this, $line);
458 458
 
459 459
 		$this->openNode($node);
460 460
 
461
-		$content=  $line->slice(1);
462
-		$ent_flag= $this->htsl->getConfig('ENT_flags',$this->docType);
461
+		$content=$line->slice(1);
462
+		$ent_flag=$this->htsl->getConfig('ENT_flags', $this->docType);
463 463
 
464 464
 		$this->appendLine("<?=htmlentities($content,'$ent_flag','UTF-8',false);?>");
465 465
 
@@ -475,11 +475,11 @@  discard block
 block discarded – undo
475 475
 	 */
476 476
 	protected function parseExpressionHtmlLine( Line$line ):self
477 477
 	{
478
-		$node= new StringNode($this,$line);
478
+		$node=new StringNode($this, $line);
479 479
 
480 480
 		$this->openNode($node);
481 481
 
482
-		$content=  $line->slice(1);
482
+		$content=$line->slice(1);
483 483
 
484 484
 		$this->appendLine("<?$content?>");
485 485
 
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
 	 */
496 496
 	protected function parseCommentLine( Line$line ):self
497 497
 	{
498
-		$node= new CommentNode($this,$line);
498
+		$node=new CommentNode($this, $line);
499 499
 
500 500
 		$this->openNode($node);
501 501
 
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 	 */
514 514
 	protected function parseTagLine( Line$line ):self
515 515
 	{
516
-		$tag= new TagNode($this,$line);
516
+		$tag=new TagNode($this, $line);
517 517
 
518 518
 		$this->appendLine($tag->open());
519 519
 
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
 	 */
534 534
 	protected function parseControlLine( Line$line ):self
535 535
 	{
536
-		$controlStructure= new ControlNode($this,$line);
536
+		$controlStructure=new ControlNode($this, $line);
537 537
 
538 538
 		$this->appendLine($controlStructure->open());
539 539
 
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 	 */
552 552
 	protected function parseDocControlLine( Line$line ):self
553 553
 	{
554
-		switch( $name= $line->pregGet('/(?<=^@)[\w-:]+/') ){
554
+		switch( $name=$line->pregGet('/(?<=^@)[\w-:]+/') ){
555 555
 			default:{
556 556
 				$this->throw("The @$name is not supported.");
557 557
 			}break;
@@ -581,10 +581,10 @@  discard block
 block discarded – undo
581 581
 	 */
582 582
 	protected function extend( string$fileName ):self
583 583
 	{
584
-		$this->parent= new static($this->htsl,$this->buffer->goSide($fileName),null,$this->indentation);
584
+		$this->parent=new static($this->htsl, $this->buffer->goSide($fileName), null, $this->indentation);
585 585
 
586
-		$this->docType= $this->parent->docType;
587
-		$this->indentation= $this->parent->indentation;
586
+		$this->docType=$this->parent->docType;
587
+		$this->indentation=$this->parent->indentation;
588 588
 
589 589
 		return $this;
590 590
 	}
@@ -596,15 +596,15 @@  discard block
 block discarded – undo
596 596
 	 *
597 597
 	 * @return \Htsl\Parser\Document
598 598
 	 */
599
-	protected function include( Line$line ):self
599
+	protected function include(Line$line):self
600 600
 	{
601
-		$inclued= (new static($this->htsl,$this->buffer->goSide($line->pregGet('/(?<=\( ).*(?= \))/')),$this,$this->indentation))->execute()->content;
601
+		$inclued=(new static($this->htsl, $this->buffer->goSide($line->pregGet('/(?<=\( ).*(?= \))/')), $this, $this->indentation))->execute()->content;
602 602
 
603 603
 		if( false!==$this->indentation ){
604
-			$inclued= preg_replace('/(?<=^|\\n)(?!$)/',str_repeat($this->indentation,$this->level-$this->sectionLevel),$inclued);
604
+			$inclued=preg_replace('/(?<=^|\\n)(?!$)/', str_repeat($this->indentation, $this->level-$this->sectionLevel), $inclued);
605 605
 		}
606 606
 
607
-		$node= new StringNode($this,$line);
607
+		$node=new StringNode($this, $line);
608 608
 
609 609
 		$this->openNode($node);
610 610
 
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
 	 */
623 623
 	protected function defineSection( Line$line ):self
624 624
 	{
625
-		$node= new SectionNode($this,$line);
625
+		$node=new SectionNode($this, $line);
626 626
 
627 627
 		$node->open();
628 628
 
@@ -640,22 +640,22 @@  discard block
 block discarded – undo
640 640
 	 */
641 641
 	protected function showSection( Line$line ):self
642 642
 	{
643
-		$sectionName= $line->pregGet('/(?<=\( ).*(?= \))/');
643
+		$sectionName=$line->pregGet('/(?<=\( ).*(?= \))/');
644 644
 
645
-		if( !isset($this->sections[$sectionName]) ){
646
-			$this->openNode(new StringNode($this,$line));
645
+		if( !isset($this->sections[ $sectionName ]) ){
646
+			$this->openNode(new StringNode($this, $line));
647 647
 
648 648
 			return $this;
649 649
 		}
650
-		$content= $this->sections[$sectionName]->content;
650
+		$content=$this->sections[ $sectionName ]->content;
651 651
 
652 652
 		if( false!==$this->indentation ){
653
-			$content= preg_replace('/(?<=^|\\n)(?!$)/',str_repeat($this->indentation,$this->level),$content);
653
+			$content=preg_replace('/(?<=^|\\n)(?!$)/', str_repeat($this->indentation, $this->level), $content);
654 654
 		}
655 655
 
656 656
 		$this->append($content);
657 657
 
658
-		$node= new NamelessSectionNode($this,$line);
658
+		$node=new NamelessSectionNode($this, $line);
659 659
 
660 660
 		$node->open();
661 661
 
@@ -672,8 +672,8 @@  discard block
 block discarded – undo
672 672
 	public function setSection( Section$section=null ):self
673 673
 	{
674 674
 		if( !$section ){
675
-			$this->sectionLevel= 0;
676
-			$this->currentSection= null;
675
+			$this->sectionLevel=0;
676
+			$this->currentSection=null;
677 677
 
678 678
 			return $this;
679 679
 		}
@@ -682,17 +682,17 @@  discard block
 block discarded – undo
682 682
 			$this->throw('Nesting definition of section is forbidden.');
683 683
 		}
684 684
 
685
-		if( isset($this->parent->sections[$section->name]) ){
685
+		if( isset($this->parent->sections[ $section->name ]) ){
686 686
 			$this->throw("Section $sectionName already defined.");
687 687
 		}
688 688
 
689
-		$this->currentSection= $section;
689
+		$this->currentSection=$section;
690 690
 
691 691
 		if( $section->name ){
692
-			$this->parent->sections[$section->name]=$section;
692
+			$this->parent->sections[ $section->name ]=$section;
693 693
 		}
694 694
 
695
-		$this->sectionLevel= $this->level+1;
695
+		$this->sectionLevel=$this->level+1;
696 696
 
697 697
 		return $this;
698 698
 	}
@@ -706,8 +706,8 @@  discard block
 block discarded – undo
706 706
 	{
707 707
 		if( $this->parent ){
708 708
 			foreach( $this->sections as $name=>$section ){
709
-				if( !isset($this->parent->sections[$name]) ){
710
-					$this->parent->sections[$name]=$section;
709
+				if( !isset($this->parent->sections[ $name ]) ){
710
+					$this->parent->sections[ $name ]=$section;
711 711
 				};
712 712
 			}
713 713
 		}
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
 	 */
725 725
 	public function htmlEntities( string$input ):string
726 726
 	{
727
-		return htmlentities($input,$this->htsl->getConfig('ENT_flags',$this->docType),'UTF-8',false);
727
+		return htmlentities($input, $this->htsl->getConfig('ENT_flags', $this->docType), 'UTF-8', false);
728 728
 	}
729 729
 
730 730
 	/**
@@ -734,12 +734,12 @@  discard block
 block discarded – undo
734 734
 	 */
735 735
 	protected function setLevel( int$level ):self
736 736
 	{
737
-		$level-= $this->level;
737
+		$level-=$this->level;
738 738
 
739 739
 		if( $level<=0 ){
740 740
 			$this->closeNodes(-$level);
741 741
 		}elseif( $level==1 ){
742
-			$this->level+= 1;
742
+			$this->level+=1;
743 743
 		}else{
744 744
 			$this->throw('Indent error.');
745 745
 		}
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
 	 */
757 757
 	protected function openNode( Node$node ):self
758 758
 	{
759
-		array_push($this->openedNodes,$node);
759
+		array_push($this->openedNodes, $node);
760 760
 
761 761
 		$node->scope and $this->setScope($node);
762 762
 
@@ -775,13 +775,13 @@  discard block
 block discarded – undo
775 775
 		if( empty($this->openedNodes) ) return $this;
776 776
 
777 777
 		while( $level-->=0 ){
778
-			$node= array_pop($this->openedNodes);
778
+			$node=array_pop($this->openedNodes);
779 779
 
780 780
 			$node->scope and $this->removeScope($node);
781 781
 
782 782
 			$closer=$node->close($this->currentLine) and $this->appendLine($closer);
783 783
 
784
-			$this->level-= $level>=0 ?1:0;
784
+			$this->level-=$level>=0? 1 : 0;
785 785
 		}
786 786
 
787 787
 		return $this;
@@ -794,7 +794,7 @@  discard block
 block discarded – undo
794 794
 	 */
795 795
 	protected function setScope( Node$scope ):int
796 796
 	{
797
-		return array_unshift($this->scopes,$scope);
797
+		return array_unshift($this->scopes, $scope);
798 798
 	}
799 799
 
800 800
 	/**
@@ -804,7 +804,7 @@  discard block
 block discarded – undo
804 804
 	 */
805 805
 	public function getScope()
806 806
 	{
807
-		return $this->scopes[0]??null;
807
+		return $this->scopes[ 0 ]??null;
808 808
 	}
809 809
 
810 810
 	/**
@@ -833,7 +833,7 @@  discard block
 block discarded – undo
833 833
 	protected function appendLine( string$content ):self
834 834
 	{
835 835
 		if( false!==$this->indentation ){
836
-			$content= str_repeat($this->indentation,$this->level-$this->sectionLevel).$content."\n";
836
+			$content=str_repeat($this->indentation, $this->level-$this->sectionLevel).$content."\n";
837 837
 		}
838 838
 
839 839
 		return $this->append($content);
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
 	 *
875 875
 	 * @throw \Htsl\Parser\HtslParsingException
876 876
 	 */
877
-	public function throw( string$message )
877
+	public function throw(string$message)
878 878
 	{
879 879
 		throw new HtslParsingException("$message at file {$this->buffer->fileName} line $this->lineNumber");
880 880
 	}
Please login to merge, or discard this patch.
Braces   +11 added lines, -10 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 			$this->parent= $parent;
150 150
 			$this->docType= $parent->docType;
151 151
 			$this->indentation= $parent->indentation;
152
-		}else{
152
+		} else{
153 153
 			$this->parseFirstLine();
154 154
 		}
155 155
 	}
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 	{
189 189
 		if( $this->parent ){
190 190
 			return $this->execute()->parent->getContent();
191
-		}else{
191
+		} else{
192 192
 			return $this->execute()->content;
193 193
 		}
194 194
 	}
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 
308 308
 			if( $this->embedment ){
309 309
 				$this->embeddingParse($line);
310
-			}else{
310
+			} else{
311 311
 				$this->parseLine($line);
312 312
 			}
313 313
 		}
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 	{
333 333
 		if( $line->content==='<}' ){
334 334
 			$this->breakEmbedding();
335
-		}else{
335
+		} else{
336 336
 			$this->embedment->parseLine($line->getSubIndentLine());
337 337
 		}
338 338
 		return $this;
@@ -386,8 +386,7 @@  discard block
 block discarded – undo
386 386
 			}break;
387 387
 			case '`':{
388 388
 				if( '='===$line->getChar(1) )
389
-					{ $this->parseExpressionHtmlLine($line); }
390
-				else
389
+					{ $this->parseExpressionHtmlLine($line); } else
391 390
 					{ $this->parseHtmlLine($line); }
392 391
 			}break;
393 392
 			case '=':{
@@ -738,9 +737,9 @@  discard block
 block discarded – undo
738 737
 
739 738
 		if( $level<=0 ){
740 739
 			$this->closeNodes(-$level);
741
-		}elseif( $level==1 ){
740
+		} elseif( $level==1 ){
742 741
 			$this->level+= 1;
743
-		}else{
742
+		} else{
744 743
 			$this->throw('Indent error.');
745 744
 		}
746 745
 
@@ -772,7 +771,9 @@  discard block
 block discarded – undo
772 771
 	 */
773 772
 	protected function closeNodes( int$level=0 ):self
774 773
 	{
775
-		if( empty($this->openedNodes) ) return $this;
774
+		if( empty($this->openedNodes) ){
775
+			return $this;
776
+		}
776 777
 
777 778
 		while( $level-->=0 ){
778 779
 			$node= array_pop($this->openedNodes);
@@ -850,7 +851,7 @@  discard block
 block discarded – undo
850 851
 	{
851 852
 		if( $this->currentSection ){
852 853
 			$this->currentSection->append($content);
853
-		}else{
854
+		} else{
854 855
 			$this->content.=$content;
855 856
 		}
856 857
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 		}
263 263
 
264 264
 		$this->docType= $line->content;
265
-		$docTypeContent= $this->getConfig('doc_types') or $this->throw("DocType $this->docType is not supported");
265
+		$docTypeContent= $this->getConfig('doc_types') or $this->throw("doctype $this->docType is not supported");
266 266
 
267 267
 		$this->indentation= $this->htsl->getConfig('indentation',$this->docType) ?? ( function( $scalarOrFalse ){ return is_scalar($scalarOrFalse)?$scalarOrFalse:false; } )($this->htsl->getConfig('indentation'));
268 268
 
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
 		}
684 684
 
685 685
 		if( isset($this->parent->sections[$section->name]) ){
686
-			$this->throw("Section $sectionName already defined.");
686
+			$this->throw("section $sectionName already defined.");
687 687
 		}
688 688
 
689 689
 		$this->currentSection= $section;
Please login to merge, or discard this patch.
libs/Parser/Node/TagNode.php 4 patches
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,7 +90,6 @@  discard block
 block discarded – undo
90 90
 	/**
91 91
 	 * Close this tag node, and returning node closer.
92 92
 	 *
93
-	 * @param  \Htsl\ReadingBuffer\Line   $closerLine  The line when node closed.
94 93
 	 *
95 94
 	 * @return string
96 95
 	 */
@@ -208,7 +207,7 @@  discard block
 block discarded – undo
208 207
 	/**
209 208
 	 * Parsing #ids .classes ^titles [styles] %event{>listeners<} and {other attributes}
210 209
 	 *
211
-	 * @return \Htsl\Parser\Node\TagNode
210
+	 * @return string
212 211
 	 */
213 212
 	protected function parseCommonAttributes():string
214 213
 	{
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -161,11 +161,11 @@
 block discarded – undo
161 161
 		if( strlen($link) ){
162 162
 			if( isset($this->config['target']) && ':'===$link{0} ){
163 163
 				$this->setAttribute($this->config['link'],'javascript'.$link);
164
-			}elseif( '//'===($firstTwoLetters=substr($link,0,2)) ){
164
+			} elseif( '//'===($firstTwoLetters=substr($link,0,2)) ){
165 165
 				$this->setAttribute($this->config['link'],'http:'.$link);
166
-			}elseif( '\\\\'===$firstTwoLetters ){
166
+			} elseif( '\\\\'===$firstTwoLetters ){
167 167
 				$this->setAttribute($this->config['link'],'https://'.substr($link,2));
168
-			}else{
168
+			} else{
169 169
 				$this->setAttribute($this->config['link'],$this->checkExpression($link));
170 170
 			}
171 171
 		}
Please login to merge, or discard this patch.
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 *
31 31
 	 * @var array
32 32
 	 */
33
-	private $attributes=[];
33
+	private $attributes=[ ];
34 34
 
35 35
 	/**
36 36
 	 * Real constructor.
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
 	protected function construct():parent
41 41
 	{
42 42
 
43
-		$name= $this->line->pregGet('/(?<=^-)[\w-:]+/');
43
+		$name=$this->line->pregGet('/(?<=^-)[\w-:]+/');
44 44
 		$this->name=$name;
45 45
 
46
-		$this->loadConfig($name,$this->document);
46
+		$this->loadConfig($name, $this->document);
47 47
 
48
-		$this->tagName=$this->config['name']??$name;
49
-		$this->isEmpty= $this->line->getChar(-1)==='/' || $this->document->getConfig('empty_tags',$this->tagName);
50
-		isset($this->config['default_attributes']) and array_walk($this->config['default_attributes'],function( $value,$key ){ $this->setAttribute($key,$value); });
48
+		$this->tagName=$this->config[ 'name' ]??$name;
49
+		$this->isEmpty=$this->line->getChar(-1)==='/' || $this->document->getConfig('empty_tags', $this->tagName);
50
+		isset($this->config[ 'default_attributes' ]) and array_walk($this->config[ 'default_attributes' ], function( $value, $key ){ $this->setAttribute($key, $value); });
51 51
 
52 52
 		return $this;
53 53
 	}
@@ -59,30 +59,30 @@  discard block
 block discarded – undo
59 59
 	 */
60 60
 	public function open():string
61 61
 	{
62
-		if( isset($this->config['opener']) )
63
-			{ return $this->config['opener']; }
62
+		if( isset($this->config[ 'opener' ]) )
63
+			{ return $this->config[ 'opener' ]; }
64 64
 
65
-		if( isset($this->config['params']) )
65
+		if( isset($this->config[ 'params' ]) )
66 66
 			{ $this->parseParams(); }
67 67
 
68
-		if( isset($this->config['name_value']) )
68
+		if( isset($this->config[ 'name_value' ]) )
69 69
 			{ $this->parseNameValue(); }
70 70
 
71
-		if( isset($this->config['link']) )
71
+		if( isset($this->config[ 'link' ]) )
72 72
 			{ $this->parseLink(); }
73 73
 
74
-		if( isset($this->config['target']) )
74
+		if( isset($this->config[ 'target' ]) )
75 75
 			{ $this->parseTarget(); }
76 76
 
77
-		if( isset($this->config['alt']) )
77
+		if( isset($this->config[ 'alt' ]) )
78 78
 			{ $this->parseAlt(); }
79 79
 
80 80
 		$this->parseCommonAttributes();
81 81
 
82
-		if( isset($this->config['in_scope']) && isset($this->config['scope_function']) && is_callable($this->config['scope_function']) )
83
-			{ $this->config['scope_function']->call($this,$this->document->scope); }
82
+		if( isset($this->config[ 'in_scope' ]) && isset($this->config[ 'scope_function' ]) && is_callable($this->config[ 'scope_function' ]) )
83
+			{ $this->config[ 'scope_function' ]->call($this, $this->document->scope); }
84 84
 
85
-		$finisher= $this->isEmpty ? ' />' : '>';
85
+		$finisher=$this->isEmpty? ' />' : '>';
86 86
 
87 87
 		return "<{$this->tagName}{$this->attributesString}{$finisher}";
88 88
 	}
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 */
97 97
 	public function close( Line$Line ):string
98 98
 	{
99
-		return $this->isEmpty ? '' : $this->config['closer']??"</{$this->tagName}>";
99
+		return $this->isEmpty? '' : $this->config[ 'closer' ]??"</{$this->tagName}>";
100 100
 	}
101 101
 
102 102
 	/**
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 	 */
107 107
 	public function getEmbed():string
108 108
 	{
109
-		return $this->config['embedding']??'';
109
+		return $this->config[ 'embedding' ]??'';
110 110
 	}
111 111
 
112 112
 	/**
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 	 */
117 117
 	public function getScope()
118 118
 	{
119
-		return $this->config['scope']??null;
119
+		return $this->config[ 'scope' ]??null;
120 120
 	}
121 121
 
122 122
 	/**
@@ -126,11 +126,11 @@  discard block
 block discarded – undo
126 126
 	 */
127 127
 	protected function parseParams():self
128 128
 	{
129
-		$params= preg_split('/(?<!\\\\)\\|/',$this->line->pregGet('/^-[\w-:]+\((.*?)\)(?= |(\\{>)?$)/',1));
129
+		$params=preg_split('/(?<!\\\\)\\|/', $this->line->pregGet('/^-[\w-:]+\((.*?)\)(?= |(\\{>)?$)/', 1));
130 130
 
131
-		if( ($m= count($params)) != ($n= count($this->config['params'])) ){$this->document->throw("Tag $this->name has $n parameters $m given.");}
131
+		if( ($m=count($params))!=($n=count($this->config[ 'params' ])) ){$this->document->throw("Tag $this->name has $n parameters $m given."); }
132 132
 
133
-		array_map(function( $key, $value ){return $this->setAttribute($key,str_replace('\\|','|',$value));},$this->config['params'],$params);
133
+		array_map(function( $key, $value ){return $this->setAttribute($key, str_replace('\\|', '|', $value)); },$this->config[ 'params' ], $params);
134 134
 
135 135
 		return $this;
136 136
 	}
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
 	 */
143 143
 	protected function parseNameValue():self
144 144
 	{
145
-		$params= $this->line->pregGet('/ <(.*?)>(?= |$)/',1)
146
-		 and $params= preg_split('/(?<!\\\\)\\|/',$params)
147
-		  and array_map(function( $key, $value ){return isset($key)&&isset($value) ? $this->setAttribute($key,$this->checkExpression(str_replace('\\|','|',$value))) : '';},$this->config['name_value'],$params);
145
+		$params=$this->line->pregGet('/ <(.*?)>(?= |$)/', 1)
146
+		 and $params=preg_split('/(?<!\\\\)\\|/', $params)
147
+		  and array_map(function( $key, $value ){return isset($key) && isset($value)? $this->setAttribute($key, $this->checkExpression(str_replace('\\|', '|', $value))) : ''; },$this->config[ 'name_value' ], $params);
148 148
 
149 149
 		return $this;
150 150
 	}
@@ -156,17 +156,17 @@  discard block
 block discarded – undo
156 156
 	 */
157 157
 	protected function parseLink():self
158 158
 	{
159
-		$link= $this->line->pregGet('/ @((?!\()(?:[^ ]| (?=[a-zA-Z0-9]))+|(?<exp>\((?:[^()]+|(?&exp)?)+?\)))(?= |$)/',1);
159
+		$link=$this->line->pregGet('/ @((?!\()(?:[^ ]| (?=[a-zA-Z0-9]))+|(?<exp>\((?:[^()]+|(?&exp)?)+?\)))(?= |$)/', 1);
160 160
 
161 161
 		if( strlen($link) ){
162
-			if( isset($this->config['target']) && ':'===$link{0} ){
163
-				$this->setAttribute($this->config['link'],'javascript'.$link);
164
-			}elseif( '//'===($firstTwoLetters=substr($link,0,2)) ){
165
-				$this->setAttribute($this->config['link'],'http:'.$link);
162
+			if( isset($this->config[ 'target' ]) && ':'===$link{0} ){
163
+				$this->setAttribute($this->config[ 'link' ], 'javascript'.$link);
164
+			}elseif( '//'===($firstTwoLetters=substr($link, 0, 2)) ){
165
+				$this->setAttribute($this->config[ 'link' ], 'http:'.$link);
166 166
 			}elseif( '\\\\'===$firstTwoLetters ){
167
-				$this->setAttribute($this->config['link'],'https://'.substr($link,2));
167
+				$this->setAttribute($this->config[ 'link' ], 'https://'.substr($link, 2));
168 168
 			}else{
169
-				$this->setAttribute($this->config['link'],$this->checkExpression($link));
169
+				$this->setAttribute($this->config[ 'link' ], $this->checkExpression($link));
170 170
 			}
171 171
 		}
172 172
 
@@ -180,10 +180,10 @@  discard block
 block discarded – undo
180 180
 	 */
181 181
 	protected function parseTarget():self
182 182
 	{
183
-		$target= $this->line->pregGet('/ >((?!\()(?:[^ ]| (?=[a-zA-Z0-9]))+|(?<exp>\((?:[^()]+|(?&exp)?)+?\)))(?= |$)/',1);
183
+		$target=$this->line->pregGet('/ >((?!\()(?:[^ ]| (?=[a-zA-Z0-9]))+|(?<exp>\((?:[^()]+|(?&exp)?)+?\)))(?= |$)/', 1);
184 184
 
185 185
 		if( strlen($target) ){
186
-			$this->setAttribute($this->config['target'],$this->checkExpression($target));
186
+			$this->setAttribute($this->config[ 'target' ], $this->checkExpression($target));
187 187
 		}
188 188
 
189 189
 		return $this;
@@ -196,10 +196,10 @@  discard block
 block discarded – undo
196 196
 	 */
197 197
 	protected function parseAlt():self
198 198
 	{
199
-		$alt= $this->line->pregGet('/ _((?!\()(?:[^ ]| (?=[a-zA-Z0-9]))+|(?<exp>\((?:[^()]+|(?&exp)?)+?\)))(?= |$)/',1);
199
+		$alt=$this->line->pregGet('/ _((?!\()(?:[^ ]| (?=[a-zA-Z0-9]))+|(?<exp>\((?:[^()]+|(?&exp)?)+?\)))(?= |$)/', 1);
200 200
 
201 201
 		if( strlen($alt) ){
202
-			$this->setAttribute($this->config['alt'],$this->checkExpression($alt));
202
+			$this->setAttribute($this->config[ 'alt' ], $this->checkExpression($alt));
203 203
 		}
204 204
 
205 205
 		return $this;
@@ -212,33 +212,33 @@  discard block
 block discarded – undo
212 212
 	 */
213 213
 	protected function parseCommonAttributes():string
214 214
 	{
215
-		$attributes= '';
215
+		$attributes='';
216 216
 
217
-		$id= $this->line->pregGet('/ #([^ ]+|(?<exp>\((?:[^()]+|(?&exp)?)+?\)))(?= |$)/',1)
218
-		 and $this->setAttribute('id',$id);
217
+		$id=$this->line->pregGet('/ #([^ ]+|(?<exp>\((?:[^()]+|(?&exp)?)+?\)))(?= |$)/', 1)
218
+		 and $this->setAttribute('id', $id);
219 219
 
220
-		$classes= $this->line->pregGet('/ \.[^ ]+(?= |$)/')
221
-		 and preg_match_all('/\.((?(?!\()[^.]+|(?<exp>\((?:[^()]+|(?&exp)?)+?\))))/',$classes,$matches)
222
-		  and $classes= implode(' ',array_filter(array_map(function( $className ){return $this->checkExpression($className);},$matches[1])))
223
-		   and $this->setAttribute('class',$classes);
220
+		$classes=$this->line->pregGet('/ \.[^ ]+(?= |$)/')
221
+		 and preg_match_all('/\.((?(?!\()[^.]+|(?<exp>\((?:[^()]+|(?&exp)?)+?\))))/', $classes, $matches)
222
+		  and $classes=implode(' ', array_filter(array_map(function( $className ){return $this->checkExpression($className); },$matches[ 1 ])))
223
+		   and $this->setAttribute('class', $classes);
224 224
 
225
-		$title= $this->line->pregGet('/ \^((?!\()(?:[^ ]| (?=[a-zA-Z0-9]))+|(?<exp>\((?:[^()]+|(?&exp)?)+?\)))(?= |$)/',1)
226
-		 and $this->setAttribute('title',$title);
225
+		$title=$this->line->pregGet('/ \^((?!\()(?:[^ ]| (?=[a-zA-Z0-9]))+|(?<exp>\((?:[^()]+|(?&exp)?)+?\)))(?= |$)/', 1)
226
+		 and $this->setAttribute('title', $title);
227 227
 
228
-		$style= $this->line->pregGet('/ \[([^\]]+;)(?=\]( |$))/',1)
229
-		 and $this->setAttribute('style',$style);
228
+		$style=$this->line->pregGet('/ \[([^\]]+;)(?=\]( |$))/', 1)
229
+		 and $this->setAttribute('style', $style);
230 230
 
231
-		$eventListeners= $this->line->pregMap('/ %(\w+)\{>(.*?)<\}(?= |$)/',function( $string, $name, $code ){
232
-			$this->setAttribute('on'.$name,str_replace('"','&quot;',$code));
231
+		$eventListeners=$this->line->pregMap('/ %(\w+)\{>(.*?)<\}(?= |$)/', function( $string, $name, $code ){
232
+			$this->setAttribute('on'.$name, str_replace('"', '&quot;', $code));
233 233
 		})
234
-		 and implode('',$eventListeners);
234
+		 and implode('', $eventListeners);
235 235
 
236
-		$other= $this->line->pregGet('/(?<=\{).*?(?=;\}( |$))/')
236
+		$other=$this->line->pregGet('/(?<=\{).*?(?=;\}( |$))/')
237 237
 		 and array_map(function( $keyValue ){
238
-			preg_replace_callback('/^([\w-:]+)(?:\?(.+?))?(?:\=(.*))?$/',function($matches){
239
-				$this->setAttribute($matches[1],($matches[3]??$matches[1])?:$matches[1],$matches[2]??null);
238
+			preg_replace_callback('/^([\w-:]+)(?:\?(.+?))?(?:\=(.*))?$/', function( $matches ){
239
+				$this->setAttribute($matches[ 1 ], ($matches[ 3 ]??$matches[ 1 ])?: $matches[ 1 ], $matches[ 2 ]??null);
240 240
 			},$keyValue);
241
-		},explode(';',$other));
241
+		},explode(';', $other));
242 242
 
243 243
 		return $attributes;
244 244
 	}
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 	 */
253 253
 	protected function checkExpression( string$value ):string
254 254
 	{
255
-		return preg_match('/^\(.*\)$/',$value) ? '<?='.substr($value,1,-1).';?>' : str_replace('"','&quot;',$value);
255
+		return preg_match('/^\(.*\)$/', $value)? '<?='.substr($value, 1, -1).';?>' : str_replace('"', '&quot;', $value);
256 256
 	}
257 257
 
258 258
 	/**
@@ -263,13 +263,13 @@  discard block
 block discarded – undo
263 263
 	protected function getAttributesString():string
264 264
 	{
265 265
 		ksort($this->attributes);
266
-		return implode('',array_map(static function( string$key, array$data ){
267
-			return (isset($data['condition'])&&strlen($data['condition'])?
268
-				"<?php if( {$data['condition']} ){?> $key=\"{$data['value']}\"<?php }?>"
266
+		return implode('', array_map(static function( string$key, array$data ){
267
+			return (isset($data[ 'condition' ]) && strlen($data[ 'condition' ])?
268
+				"<?php if( {$data[ 'condition' ]} ){?> $key=\"{$data[ 'value' ]}\"<?php }?>"
269 269
 				:
270
-				" $key=\"{$data['value']}\""
270
+				" $key=\"{$data[ 'value' ]}\""
271 271
 			);
272
-		},array_keys($this->attributes),$this->attributes));
272
+		},array_keys($this->attributes), $this->attributes));
273 273
 	}
274 274
 
275 275
 	/**
@@ -281,10 +281,10 @@  discard block
 block discarded – undo
281 281
 	 */
282 282
 	protected function setAttribute( string$key, string$value, string$condition=null ):self
283 283
 	{
284
-		if( isset($this->attributes[$key]) )
284
+		if( isset($this->attributes[ $key ]) )
285 285
 			{ $this->document->throw("Attribute $key of $this->name cannot redeclare."); }
286 286
 
287
-		$this->attributes[$key]=[
287
+		$this->attributes[ $key ]=[
288 288
 			'value'=> $value,
289 289
 			'condition'=> $condition,
290 290
 		];
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 	 */
307 307
 	public function offsetExists( $offset ):bool
308 308
 	{
309
-		return isset($this->attributes[$offset]);
309
+		return isset($this->attributes[ $offset ]);
310 310
 	}
311 311
 
312 312
 	/**
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 	 */
319 319
 	public function offsetGet( $offset )
320 320
 	{
321
-		return $this->attributes[$offset]??null;
321
+		return $this->attributes[ $offset ]??null;
322 322
 	}
323 323
 
324 324
 	/**
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 	 */
330 330
 	public function offsetSet( $offset, $value )
331 331
 	{
332
-		$this->setAttribute($offset,$value);
332
+		$this->setAttribute($offset, $value);
333 333
 	}
334 334
 
335 335
 	/**
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 	 */
340 340
 	public function offsetUnset( $offset )
341 341
 	{
342
-		if( isset($this->attributes[$offset]) )
343
-			{ unset($this->attributes[$offset]); }
342
+		if( isset($this->attributes[ $offset ]) )
343
+			{ unset($this->attributes[ $offset ]); }
344 344
 	}
345 345
 }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	{
129 129
 		$params= preg_split('/(?<!\\\\)\\|/',$this->line->pregGet('/^-[\w-:]+\((.*?)\)(?= |(\\{>)?$)/',1));
130 130
 
131
-		if( ($m= count($params)) != ($n= count($this->config['params'])) ){$this->document->throw("Tag $this->name has $n parameters $m given.");}
131
+		if( ($m= count($params)) != ($n= count($this->config['params'])) ){$this->document->throw("tag $this->name has $n parameters $m given.");}
132 132
 
133 133
 		array_map(function( $key, $value ){return $this->setAttribute($key,str_replace('\\|','|',$value));},$this->config['params'],$params);
134 134
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 	protected function setAttribute( string$key, string$value, string$condition=null ):self
283 283
 	{
284 284
 		if( isset($this->attributes[$key]) )
285
-			{ $this->document->throw("Attribute $key of $this->name cannot redeclare."); }
285
+			{ $this->document->throw("attribute $key of $this->name cannot redeclare."); }
286 286
 
287 287
 		$this->attributes[$key]=[
288 288
 			'value'=> $value,
Please login to merge, or discard this patch.
libs/ReadingBuffer/Contracts/ABuffer.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
 	/**
40 40
 	 * Get a line of the document.
41
-	 * @return \Htsl\ReadingBuffer\Line
41
+	 * @return string
42 42
 	 */
43 43
 	public function getFileName():string
44 44
 	{
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 	/**
49 49
 	 * Getting another file reference file of this buffer.
50 50
 	 *
51
-	 * @param  string $filePath
52 51
 	 *
52
+	 * @param string $fileName
53 53
 	 * @return \Htsl\ReadingBuffer\Contracts\ABuffer
54 54
 	 */
55 55
 	abstract public function goSide( $fileName ):self;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@
 block discarded – undo
23 23
 	 *
24 24
 	 * @var string
25 25
 	 */
26
-	protected $fileName= '';
26
+	protected $fileName='';
27 27
 
28 28
 	public function __construct( Htsl$htsl )
29 29
 	{
30
-		$this->htsl= $htsl;
30
+		$this->htsl=$htsl;
31 31
 	}
32 32
 
33 33
 	/**
Please login to merge, or discard this patch.