1 | <?php |
||
18 | class FeatureNode implements KeywordNodeInterface, TaggedNodeInterface |
||
19 | { |
||
20 | /** |
||
21 | * @var null|string |
||
22 | */ |
||
23 | private $title; |
||
24 | /** |
||
25 | * @var null|string |
||
26 | */ |
||
27 | private $description; |
||
28 | /** |
||
29 | * @var string[] |
||
30 | */ |
||
31 | private $tags = array(); |
||
32 | /** |
||
33 | * @var null|BackgroundNode |
||
34 | */ |
||
35 | private $background; |
||
36 | /** |
||
37 | * @var ScenarioInterface[] |
||
38 | */ |
||
39 | private $scenarios = array(); |
||
40 | /** |
||
41 | * @var string |
||
42 | */ |
||
43 | private $keyword; |
||
44 | /** |
||
45 | * @var string |
||
46 | */ |
||
47 | private $language; |
||
48 | /** |
||
49 | * @var null|string |
||
50 | */ |
||
51 | private $file; |
||
52 | /** |
||
53 | * @var integer |
||
54 | */ |
||
55 | private $line; |
||
56 | |||
57 | /** |
||
58 | * Initializes feature. |
||
59 | * |
||
60 | * @param null|string $title |
||
61 | * @param null|string $description |
||
62 | * @param string[] $tags |
||
63 | * @param null|BackgroundNode $background |
||
64 | * @param ScenarioInterface[] $scenarios |
||
65 | * @param string $keyword |
||
66 | * @param string $language |
||
67 | * @param null|string $file The absolute path to the feature file. |
||
68 | * @param integer $line |
||
69 | */ |
||
70 | 271 | public function __construct( |
|
95 | |||
96 | /** |
||
97 | * Returns node type string |
||
98 | * |
||
99 | * @return string |
||
100 | */ |
||
101 | 1 | public function getNodeType() |
|
105 | |||
106 | /** |
||
107 | * Returns feature title. |
||
108 | * |
||
109 | * @return null|string |
||
110 | */ |
||
111 | 47 | public function getTitle() |
|
115 | |||
116 | /** |
||
117 | * Checks if feature has a description. |
||
118 | * |
||
119 | * @return Boolean |
||
120 | */ |
||
121 | public function hasDescription() |
||
125 | |||
126 | /** |
||
127 | * Returns feature description. |
||
128 | * |
||
129 | * @return null|string |
||
130 | */ |
||
131 | 47 | public function getDescription() |
|
135 | |||
136 | /** |
||
137 | * Checks if feature is tagged with tag. |
||
138 | * |
||
139 | * @param string $tag |
||
140 | * |
||
141 | * @return Boolean |
||
142 | */ |
||
143 | public function hasTag($tag) |
||
147 | |||
148 | /** |
||
149 | * Checks if feature has tags. |
||
150 | * |
||
151 | * @return Boolean |
||
152 | */ |
||
153 | 2 | public function hasTags() |
|
157 | |||
158 | /** |
||
159 | * Returns feature tags. |
||
160 | * |
||
161 | * @return string[] |
||
162 | */ |
||
163 | 45 | public function getTags() |
|
167 | |||
168 | /** |
||
169 | * Checks if feature has background. |
||
170 | * |
||
171 | * @return Boolean |
||
172 | */ |
||
173 | 1 | public function hasBackground() |
|
177 | |||
178 | /** |
||
179 | * Returns feature background. |
||
180 | * |
||
181 | * @return null|BackgroundNode |
||
182 | */ |
||
183 | 46 | public function getBackground() |
|
187 | |||
188 | /** |
||
189 | * Checks if feature has scenarios. |
||
190 | * |
||
191 | * @return Boolean |
||
192 | */ |
||
193 | 2 | public function hasScenarios() |
|
197 | |||
198 | /** |
||
199 | * Returns feature scenarios. |
||
200 | * |
||
201 | * @return ScenarioInterface[] |
||
202 | */ |
||
203 | 49 | public function getScenarios() |
|
207 | |||
208 | /** |
||
209 | * Returns feature keyword. |
||
210 | * |
||
211 | * @return string |
||
212 | */ |
||
213 | 42 | public function getKeyword() |
|
217 | |||
218 | /** |
||
219 | * Returns feature language. |
||
220 | * |
||
221 | * @return string |
||
222 | */ |
||
223 | 43 | public function getLanguage() |
|
227 | |||
228 | /** |
||
229 | * Returns feature file as an absolute path. |
||
230 | * |
||
231 | * @return null|string |
||
232 | */ |
||
233 | 14 | public function getFile() |
|
237 | |||
238 | /** |
||
239 | * Returns feature declaration line number. |
||
240 | * |
||
241 | * @return integer |
||
242 | */ |
||
243 | 50 | public function getLine() |
|
247 | |||
248 | /** |
||
249 | * Returns whether the file path is an absolute path. |
||
250 | * |
||
251 | * @param string $file A file path |
||
252 | * |
||
253 | * @return bool |
||
254 | * |
||
255 | * @see https://github.com/symfony/filesystem/blob/master/Filesystem.php |
||
256 | */ |
||
257 | 229 | protected function isAbsolutePath($file) |
|
271 | } |
||
272 |
If you suppress an error, we recommend checking for the error condition explicitly: