1 | <?php |
||
5 | class RuleNode implements KeywordNodeInterface |
||
6 | { |
||
7 | |||
8 | /** |
||
9 | * @var string |
||
10 | */ |
||
11 | private $title; |
||
12 | /** |
||
13 | * @var int |
||
14 | */ |
||
15 | private $line; |
||
16 | /** |
||
17 | * @var null|BackgroundNode |
||
18 | */ |
||
19 | private $background; |
||
20 | /** |
||
21 | * @var ExampleNode[] |
||
22 | */ |
||
23 | private $examples = array(); |
||
24 | |||
25 | /** |
||
26 | * Initializes Rule |
||
27 | * |
||
28 | * @param string $title |
||
29 | * @param integer $line |
||
30 | * @param BackgroundNode|null $background |
||
31 | * @param ExampleNode[] $examples |
||
32 | */ |
||
33 | 2 | public function __construct($title, $line, BackgroundNode $background = null, array $examples = array()) |
|
41 | |||
42 | 2 | private function addExample(ExampleNode $example) |
|
46 | |||
47 | /** |
||
48 | * Returns node type string |
||
49 | * |
||
50 | * @return string |
||
51 | */ |
||
52 | public function getNodeType() |
||
56 | |||
57 | /** |
||
58 | * Returns node keyword. |
||
59 | * |
||
60 | * @return string |
||
61 | */ |
||
62 | public function getKeyword() |
||
66 | |||
67 | /** |
||
68 | * Returns node title. |
||
69 | * |
||
70 | * @return null|string |
||
71 | */ |
||
72 | 1 | public function getTitle() |
|
76 | |||
77 | /** |
||
78 | * Returns feature declaration line number. |
||
79 | * |
||
80 | * @return integer |
||
81 | */ |
||
82 | 1 | public function getLine() |
|
86 | |||
87 | /** |
||
88 | * Returns rule background. |
||
89 | * |
||
90 | * @return null|BackgroundNode |
||
91 | */ |
||
92 | public function getBackground() |
||
96 | |||
97 | /** |
||
98 | * Returns rule examples |
||
99 | * |
||
100 | * @return ExampleNode[] |
||
101 | */ |
||
102 | 1 | public function getExamples() |
|
106 | } |
||
107 |