Completed
Branch master (e75327)
by Fenz
02:48
created
libs/Parser/Node/StringNode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 	 *
38 38
 	 * @return string
39 39
 	 */
40
-	public function close( Line$closerLine ):string
40
+	public function close(Line$closerLine):string
41 41
 	{
42 42
 		return '';
43 43
 	}
Please login to merge, or discard this patch.
libs/Parser/Node/Contracts/ANode.php 2 patches
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -49,11 +49,11 @@  discard block
 block discarded – undo
49 49
 	 * @param \Htsl\Parser\Document     $document
50 50
 	 * @param \Htsl\ReadingBuffer\Line  $line
51 51
 	 */
52
-	final public function __construct( Document$document, Line$line )
52
+	final public function __construct(Document$document, Line$line)
53 53
 	{
54
-		$this->htsl= $document->htsl;
55
-		$this->document= $document;
56
-		$this->line= $line;
54
+		$this->htsl=$document->htsl;
55
+		$this->document=$document;
56
+		$this->line=$line;
57 57
 
58 58
 		$this->construct();
59 59
 	}
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 *
80 80
 	 * @return string
81 81
 	 */
82
-	abstract public function close( Line$closerLine ):string;
82
+	abstract public function close(Line$closerLine):string;
83 83
 
84 84
 	/**
85 85
 	 * Getting whether this node contains a scope and scope name.
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	public function getNodeType()
100 100
 	{
101 101
 		static $nodeType;
102
-		return $nodeType??$nodeType= $this->nodeType??(static function($className){return strtolower(preg_replace('/(?<=\\w)([A-Z])/','_$1',preg_replace('/^(?:\\w+\\\\)*(\\w+)Node$/','$1',$className)));})(get_class($this));
102
+		return $nodeType??$nodeType=$this->nodeType??(static function($className) {return strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_$1', preg_replace('/^(?:\\w+\\\\)*(\\w+)Node$/', '$1', $className))); })(get_class($this));
103 103
 	}
104 104
 
105 105
 	/**
@@ -110,41 +110,41 @@  discard block
 block discarded – undo
110 110
 	 *
111 111
 	 * @return \Htsl\Parser\Node\Contracts\ANode
112 112
 	 */
113
-	protected function loadConfig( string$name, IConfigProvider$configProvider )
113
+	protected function loadConfig(string$name, IConfigProvider$configProvider)
114 114
 	{
115
-		$config= $configProvider->getConfig($this->nodeType.'_nodes',$name) ?: $configProvider->getConfig($this->nodeType.'_nodes','*');
115
+		$config=$configProvider->getConfig($this->nodeType.'_nodes', $name) ?: $configProvider->getConfig($this->nodeType.'_nodes', '*');
116 116
 
117
-		if( isset($config['multiple']) ){
118
-			foreach( $config['multiple'] as $value ){
119
-				if( $this->line->pregGet($value['pattern']) ){
120
-					$config= $value;
117
+		if (isset($config['multiple'])) {
118
+			foreach ($config['multiple'] as $value) {
119
+				if ($this->line->pregGet($value['pattern'])) {
120
+					$config=$value;
121 121
 					break;
122 122
 				}
123 123
 			}
124 124
 		}
125 125
 
126
-		if( isset($config['in']) ){
127
-			$config=(function( array$config )use($name){
128
-				foreach( $config['in'] as $key=>$value ){
129
-					if( $this->document->scope && $this->document->scope->scope===$key ){
130
-						$value['in_scope']= $key;
126
+		if (isset($config['in'])) {
127
+			$config=(function(array$config)use($name){
128
+				foreach ($config['in'] as $key=>$value) {
129
+					if ($this->document->scope && $this->document->scope->scope===$key) {
130
+						$value['in_scope']=$key;
131 131
 						return $value;
132 132
 					}
133 133
 				}
134
-				if( !isset($config['out']) ){
135
-					$this->document->throw("The $this->nodeType node $name only use in scope ".implode(',',array_keys($config['in'])));
134
+				if (!isset($config['out'])) {
135
+					$this->document->throw("The $this->nodeType node $name only use in scope ".implode(',', array_keys($config['in'])));
136 136
 				}
137 137
 				return $config['out'];
138 138
 			})($config);
139
-		}elseif( isset($config['only_in']) && (!$this->document->scope || !in_array($this->document->scope->scope,$config['only_in'])) ){
140
-			$this->document->throw("The $this->nodeType node $name only use in scope ".implode(',',$config['only_in']));
141
-		}elseif( isset($config['not_in']) && (!$this->document->scope || !in_array($this->document->scope->scope,$config['not_in'])) ){
142
-			$this->document->throw("The $this->nodeType node $name not use in scope ".implode(',',$config['not_in']));
139
+		}elseif (isset($config['only_in']) && (!$this->document->scope || !in_array($this->document->scope->scope, $config['only_in']))) {
140
+			$this->document->throw("The $this->nodeType node $name only use in scope ".implode(',', $config['only_in']));
141
+		}elseif (isset($config['not_in']) && (!$this->document->scope || !in_array($this->document->scope->scope, $config['not_in']))) {
142
+			$this->document->throw("The $this->nodeType node $name not use in scope ".implode(',', $config['not_in']));
143 143
 		}
144 144
 
145
-		if( !is_array($config) ){$this->document->throw("The $this->nodeType node $name is not supported.");}
145
+		if (!is_array($config)) {$this->document->throw("The $this->nodeType node $name is not supported."); }
146 146
 
147
-		$this->config= $config;
147
+		$this->config=$config;
148 148
 
149 149
 		return $this;
150 150
 	}
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -136,9 +136,9 @@
 block discarded – undo
136 136
 				}
137 137
 				return $config['out'];
138 138
 			})($config);
139
-		}elseif( isset($config['only_in']) && (!$this->document->scope || !in_array($this->document->scope->scope,$config['only_in'])) ){
139
+		} elseif( isset($config['only_in']) && (!$this->document->scope || !in_array($this->document->scope->scope,$config['only_in'])) ){
140 140
 			$this->document->throw("The $this->nodeType node $name only use in scope ".implode(',',$config['only_in']));
141
-		}elseif( isset($config['not_in']) && (!$this->document->scope || !in_array($this->document->scope->scope,$config['not_in'])) ){
141
+		} elseif( isset($config['not_in']) && (!$this->document->scope || !in_array($this->document->scope->scope,$config['not_in'])) ){
142 142
 			$this->document->throw("The $this->nodeType node $name not use in scope ".implode(',',$config['not_in']));
143 143
 		}
144 144
 
Please login to merge, or discard this patch.
libs/Parser/Node/NamelessSectionNode.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	 */
26 26
 	protected function construct():parent
27 27
 	{
28
-		$this->name= null;
28
+		$this->name=null;
29 29
 
30 30
 		return $this;
31 31
 	}
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 *
50 50
 	 * @return string
51 51
 	 */
52
-	public function close( Line$closerLine ):string
52
+	public function close(Line$closerLine):string
53 53
 	{
54 54
 		$this->document->setSection(null);
55 55
 
Please login to merge, or discard this patch.
libs/Parser/Node/SectionNode.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	 */
26 26
 	protected function construct():parent
27 27
 	{
28
-		$this->name= $this->line->pregGet('/(?<=\( ).*(?= \))/');
28
+		$this->name=$this->line->pregGet('/(?<=\( ).*(?= \))/');
29 29
 
30 30
 		return $this;
31 31
 	}
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 *
50 50
 	 * @return string
51 51
 	 */
52
-	public function close( Line$closerLine ):string
52
+	public function close(Line$closerLine):string
53 53
 	{
54 54
 		$this->document->setSection(null);
55 55
 
Please login to merge, or discard this patch.