@@ -18,7 +18,7 @@ |
||
| 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 | } |
@@ -26,7 +26,7 @@ |
||
| 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 | } |
@@ -18,13 +18,13 @@ |
||
| 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 | } |
@@ -34,9 +34,9 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | /** |
@@ -18,7 +18,7 @@ |
||
| 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 | } |
@@ -26,7 +26,7 @@ |
||
| 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 | } |
@@ -170,66 +170,66 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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'=> [ |
@@ -31,7 +31,7 @@ discard block |
||
| 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 |
||
| 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 | /** |
@@ -27,15 +27,15 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | public function __construct( Htsl$htsl, string$filePath ) |
| 29 | 29 | { |
| 30 | - substr($filePath,-5)==='.htsl' or $filePath.= '.htsl'; |
|
| 30 | + substr($filePath, -5)==='.htsl' or $filePath.='.htsl'; |
|
| 31 | 31 | |
| 32 | 32 | if( !file_exists($filePath) || !is_file($filePath) ){ |
| 33 | 33 | throw new \Exception("File $filePath not exists.", 1); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - $this->filePath= $filePath; |
|
| 36 | + $this->filePath=$filePath; |
|
| 37 | 37 | |
| 38 | - $this->handle= fopen($filePath,'r'); |
|
| 38 | + $this->handle=fopen($filePath, 'r'); |
|
| 39 | 39 | |
| 40 | 40 | parent::__construct($htsl); |
| 41 | 41 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | public function getLine():Line |
| 61 | 61 | { |
| 62 | - while( "\n"===$content= fgets($this->handle) ); |
|
| 62 | + while( "\n"===$content=fgets($this->handle) ); |
|
| 63 | 63 | |
| 64 | 64 | return new Line($content); |
| 65 | 65 | } |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function goSide( $fileName ):parent |
| 77 | 77 | { |
| 78 | - $filePath= $this->htsl->getFilePath($fileName,dirname($this->filePath)); |
|
| 78 | + $filePath=$this->htsl->getFilePath($fileName, dirname($this->filePath)); |
|
| 79 | 79 | |
| 80 | - return new static($this->htsl,$filePath); |
|
| 80 | + return new static($this->htsl, $filePath); |
|
| 81 | 81 | } |
| 82 | 82 | } |