1 | <?php |
||
7 | class ExternalParser extends AbstractSectionParser |
||
8 | { |
||
9 | private |
||
10 | $parser, |
||
|
|||
11 | $variables, |
||
12 | $filesStatus; |
||
13 | |||
14 | public function __construct(Parser $parser) |
||
22 | |||
23 | public function parseLine($line) |
||
24 | { |
||
25 | if($this->isACommentLine($line)) |
||
26 | { |
||
27 | return true; |
||
28 | } |
||
29 | |||
30 | $file = trim($line); |
||
31 | |||
32 | $found = false; |
||
33 | if($this->parser->getFileSystem()->has($file)) |
||
34 | { |
||
35 | $found = true; |
||
36 | $this->variables = $this->parser->parse($file); |
||
37 | } |
||
38 | |||
39 | $this->filesStatus[$file] = array( |
||
40 | 'found' => $found, |
||
41 | 'referencedFrom' => $this->currentFilePath, |
||
42 | ); |
||
43 | } |
||
44 | |||
45 | public function getExternalVariables() |
||
49 | |||
50 | public function getExternalFilesStatus() |
||
54 | } |
Only declaring a single property per statement allows you to later on add doc comments more easily.
It is also recommended by PSR2, so it is a common style that many people expect.