@@ -3,8 +3,6 @@ |
||
| 3 | 3 | namespace Htsl\Parser\Node; |
| 4 | 4 | |
| 5 | 5 | use Htsl\Htsl; |
| 6 | -use Htsl\ReadingBuffer\Line; |
|
| 7 | -use Htsl\Parser\Section; |
|
| 8 | 6 | |
| 9 | 7 | //////////////////////////////////////////////////////////////// |
| 10 | 8 | |
@@ -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 | } |
@@ -28,14 +28,14 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public function __construct( Htsl$htsl, string$content, string$filePath='' ) |
| 30 | 30 | { |
| 31 | - if( false!==strpos($content,"\r") ){ |
|
| 31 | + if( false!==strpos($content, "\r") ){ |
|
| 32 | 32 | throw new \Exception("Line ending must be LF.", 1); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - $this->filePath= $filePath; |
|
| 35 | + $this->filePath=$filePath; |
|
| 36 | 36 | |
| 37 | - $this->lines= array_filter(explode("\n",$content),'strlen'); |
|
| 38 | - array_unshift($this->lines,null); |
|
| 37 | + $this->lines=array_filter(explode("\n", $content), 'strlen'); |
|
| 38 | + array_unshift($this->lines, null); |
|
| 39 | 39 | |
| 40 | 40 | parent::__construct($htsl); |
| 41 | 41 | } |
@@ -63,9 +63,9 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public function goSide( $fileName ):parent |
| 65 | 65 | { |
| 66 | - $filePath= $this->htsl->getFilePath($fileName,dirname($this->filePath)); |
|
| 67 | - $content= $this->htsl->getFileContent($filePath); |
|
| 66 | + $filePath=$this->htsl->getFilePath($fileName, dirname($this->filePath)); |
|
| 67 | + $content=$this->htsl->getFileContent($filePath); |
|
| 68 | 68 | |
| 69 | - return new static($this->htsl,$content,$filePath); |
|
| 69 | + return new static($this->htsl, $content, $filePath); |
|
| 70 | 70 | } |
| 71 | 71 | } |