AEmbedment::parseLine()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
c 0
b 0
f 0
nc 1
1
<?php
2
3
namespace Htsl\Embedment\Contracts;
4
5
use Htsl\ReadingBuffer\Line;
6
use Htsl\Parser\Document;
7
use Htsl\Helper\TGetter;
8
9
////////////////////////////////////////////////////////////////
10
11
/**
12
 * @property-read string $content Embedment content.
13
 */
14
abstract class AEmbedment
15
{
16
	use TGetter;
17
18
	/**
19
	 * Embed content
20
	 *
21
	 * @var string
22
	 *
23
	 * @access protected
24
	 */
25
	protected $content='';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned correctly; expected 1 space but found 0 spaces

This check looks for improperly formatted assignments.

Every assignment must have exactly one space before and one space after the equals operator.

To illustrate:

$a = "a";
$ab = "ab";
$abc = "abc";

will have no issues, while

$a   = "a";
$ab  = "ab";
$abc = "abc";

will report issues in lines 1 and 2.

Loading history...
26
27
	/**
28
	 * The main document which this embedment embedding into.
29
	 *
30
	 * @var \Htsl\Parser\Document
31
	 *
32
	 * @access protected
33
	 */
34
	protected $document;
35
36
	/**
37
	 * Constructor.
38
	 *
39
	 * @access public
40
	 *
41
	 * @param \Htsl\Parser\Document $document
42
	 */
43
	final public function __construct( Document$document )
44
	{
45
		$this->document= $document;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned correctly; expected 1 space but found 0 spaces

This check looks for improperly formatted assignments.

Every assignment must have exactly one space before and one space after the equals operator.

To illustrate:

$a = "a";
$ab = "ab";
$abc = "abc";

will have no issues, while

$a   = "a";
$ab  = "ab";
$abc = "abc";

will report issues in lines 1 and 2.

Loading history...
46
47
		$this->construct();
48
	}
49
50
	/**
51
	 * Getting content.
52
	 *
53
	 * @access public
54
	 *
55
	 * @return string
56
	 */
57
	final public function getContent():string
58
	{
59
		return $this->content;
60
	}
61
62
	/**
63
	 * Real constructor to be rewrite.
64
	 */
65
	protected function construct(){}
66
67
	/**
68
	 * Parsing line.
69
	 *
70
	 * @access public
71
	 *
72
	 * @param  \Htsl\ReadingBuffer\Line $line
73
	 *
74
	 * @return \Htsl\Embedment\Contracts
0 ignored issues
show
Documentation introduced by
Should the return type not be \self?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
75
	 */
76
	abstract public function parseLine( Line$line ):self;
77
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
78