| Conditions | 7 |
| Paths | 6 |
| Total Lines | 27 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function trigger($eventType, $message = null) |
||
| 19 | { |
||
| 20 | switch ($eventType) { |
||
| 21 | case Analyser::EVENT_STARTING_ANALYSIS: |
||
| 22 | $this->cli->green('Starting analysis'); |
||
|
|
|||
| 23 | if (!empty($message['ignoredPaths'])) { |
||
| 24 | $this->cli->out('(ignored paths:)'); |
||
| 25 | foreach ($message['ignoredPaths'] as $ignoredPath) { |
||
| 26 | $this->cli->red("\t" . $ignoredPath); |
||
| 27 | } |
||
| 28 | } |
||
| 29 | break; |
||
| 30 | |||
| 31 | case Analyser::EVENT_STARTING_TOOL: |
||
| 32 | $this->cli->inline('Running ' . $message['description'] . '... '); |
||
| 33 | break; |
||
| 34 | |||
| 35 | case Analyser::EVENT_FINISHED_TOOL: |
||
| 36 | $this->cli->out('Done!'); |
||
| 37 | break; |
||
| 38 | |||
| 39 | case Analyser::EVENT_FINISHED_ANALYSIS: |
||
| 40 | $this->cli->br(); |
||
| 41 | $this->cli->green('Analysis complete!'); |
||
| 42 | break; |
||
| 43 | } |
||
| 44 | } |
||
| 45 | } |
||
| 46 |
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: