PHPLint uses the Symfony Event-Dispatcher Component to communicate with each internal element's by dispatching events and listening to them.
That's allow to easily add new Extension
(like progress bar
and meter
widgets), but also new output formats.
Generated by bartlett/graph-uml package via the resources/graph-uml/build.php
script.
The dispatcher is the central object of the event dispatcher system. It accepts a list of Extension
objects
that will extend PHPLint features (widgets, output formats, ...)
Each Extension
that will add new listeners must implement the Symfony EventSubscriberInterface
and also must implement one or more following PHPLint Event Interface:
BeforeCheckingInterface
: called before lint begins to runAfterCheckingInterface
: called after lint is completedBeforeLintFileInterface
: called before a file has been checkedAfterLintFileInterface
: called after a file has been checked
Default progress printer widget:
<?php
use Overtrue\PHPLint\Event\EventDispatcher;
use Overtrue\PHPLint\Extension\ProgressPrinter;
$extensions = [new ProgressPrinter()];
$dispatcher = new EventDispatcher($extensions);