1 | <?php |
||
13 | class Section |
||
14 | { |
||
15 | use TGetter; |
||
16 | |||
17 | /** |
||
18 | * Section name. |
||
19 | * |
||
20 | * @access private |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | private $name; |
||
25 | |||
26 | /** |
||
27 | * Content. |
||
28 | * |
||
29 | * @access private |
||
30 | * |
||
31 | * @var string |
||
32 | */ |
||
33 | private $content=''; |
||
|
|||
34 | |||
35 | /** |
||
36 | * Setting name and constructing instance of Section. |
||
37 | * |
||
38 | * @access public |
||
39 | * |
||
40 | * @param string | null $name |
||
41 | */ |
||
42 | public function __construct( string$name=null ) |
||
46 | |||
47 | /** |
||
48 | * Appending content to this section. |
||
49 | * |
||
50 | * @access public |
||
51 | * |
||
52 | * @param string $content |
||
53 | * |
||
54 | * @return self |
||
55 | */ |
||
56 | public function append( string$content ):self |
||
62 | |||
63 | /** |
||
64 | * Getting content of this section. |
||
65 | * |
||
66 | * @access public |
||
67 | * |
||
68 | * @return string |
||
69 | */ |
||
70 | public function getContent():string |
||
74 | |||
75 | /** |
||
76 | * Getting name of this section |
||
77 | * |
||
78 | * @access public |
||
79 | * |
||
80 | * @return string | null |
||
81 | */ |
||
82 | public function getName()#:string|null |
||
86 | } |
||
87 |
This check looks for improperly formatted assignments.
Every assignment must have exactly one space before and one space after the equals operator.
To illustrate:
will have no issues, while
will report issues in lines 1 and 2.