Completed
Push — master ( 3021e9...64aadc )
by Fenz
02:37
created

ABuffer::getFilePath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Htsl\ReadingBuffer\Contracts;
4
5
use Htsl\Htsl;
6
use Htsl\Helper\TGetter;
7
8
////////////////////////////////////////////////////////////////
9
10
/**
11
 * @property-read \Htsl\ReadingBuffer\Line $line
12
 * @property-read string                   $filePath Physical or fake path of file within this buffer.
13
 */
14
abstract class ABuffer
15
{
16
	use TGetter;
17
18
	/**
19
	 * The htsl server.
20
	 *
21
	 * @access protected
22
	 *
23
	 * @var \Htsl\Htsl
24
	 */
25
	protected $htsl;
26
27
	/**
28
	 * The file name.
29
	 *
30
	 * @access protected
31
	 *
32
	 * @var string
33
	 */
34
	protected $filePath= '';
35
36
	/**
37
	 * Constructing a buffer reading HTSL content from somewhere.
38
	 *
39
	 * @access public
40
	 *
41
	 * @param Htsl $htsl [description]
42
	 */
43
	public function __construct( Htsl$htsl )
44
	{
45
		$this->htsl= $htsl;
46
	}
47
48
	/**
49
	 * Getting a line of the document.
50
	 *
51
	 * @access public
52
	 *
53
	 * @return \Htsl\ReadingBuffer\Line
54
	 */
55
	abstract public function getLine();
56
57
	/**
58
	 * Getting physical or fake path of file within this buffer.
59
	 *
60
	 * @access public
61
	 *
62
	 * @return string
63
	 */
64
	public function getFilePath():string
65
	{
66
		return $this->filePath;
67
	}
68
69
	/**
70
	 * Getting another file reference file of this buffer.
71
	 *
72
	 * @access public
73
	 *
74
	 * @param  string $filePath
75
	 *
76
	 * @return \Htsl\ReadingBuffer\Contracts\ABuffer
77
	 */
78
	abstract public function goSide( $filePath ):self;
79
}
80