for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace phphound\output;
use phphound\Analyser;
/**
* Outputs events information to the console.
* @see TriggerableInterface
*/
trait TextTriggerTrait
{
* Output event messages.
* @param integer $eventType Command class event constant.
* @param string|null $message optional message.
* @return void
public function trigger($eventType, $message = null)
switch ($eventType) {
case Analyser::EVENT_STARTING_ANALYSIS:
$this->cli->green('Starting analysis');
cli
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
if (!empty($message['ignoredPaths'])) {
$this->cli->out('(ignored paths:)');
foreach ($message['ignoredPaths'] as $ignoredPath) {
$message['ignoredPaths']
string
$this->cli->red("\t" . $ignoredPath);
}
break;
case Analyser::EVENT_STARTING_TOOL:
$this->cli->inline('Running ' . $message['description'] . '... ');
case Analyser::EVENT_FINISHED_TOOL:
$this->cli->out('Done!');
case Analyser::EVENT_FINISHED_ANALYSIS:
$this->cli->br();
$this->cli->green('Analysis complete!');
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: