Conditions | 7 |
Paths | 6 |
Total Lines | 27 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public function trigger($eventType, $message = null) |
||
21 | { |
||
22 | switch ($eventType) { |
||
23 | case Analyser::EVENT_STARTING_ANALYSIS: |
||
24 | $this->cli->green('Starting analysis'); |
||
|
|||
25 | if (!empty($message['ignoredPaths'])) { |
||
26 | $this->cli->out('(ignored paths:)'); |
||
27 | foreach ($message['ignoredPaths'] as $ignoredPath) { |
||
28 | $this->cli->red("\t" . $ignoredPath); |
||
29 | } |
||
30 | } |
||
31 | break; |
||
32 | |||
33 | case Analyser::EVENT_STARTING_TOOL: |
||
34 | $this->cli->inline('Running ' . $message['description'] . '... '); |
||
35 | break; |
||
36 | |||
37 | case Analyser::EVENT_FINISHED_TOOL: |
||
38 | $this->cli->out('Done!'); |
||
39 | break; |
||
40 | |||
41 | case Analyser::EVENT_FINISHED_ANALYSIS: |
||
42 | $this->cli->br(); |
||
43 | $this->cli->green('Analysis complete!'); |
||
44 | break; |
||
45 | } |
||
46 | } |
||
47 | } |
||
48 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: