forked from peridot-php/leo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
peridot.php
34 lines (26 loc) · 1.08 KB
/
peridot.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
use Evenement\EventEmitterInterface;
use Peridot\Console\Environment;
use Peridot\Plugin\Prophecy\ProphecyPlugin;
use Peridot\Plugin\Watcher\WatcherPlugin;
use Peridot\Reporter\CodeCoverage\AbstractCodeCoverageReporter;
use Peridot\Reporter\CodeCoverageReporters;
use Peridot\Reporter\Dot\DotReporterPlugin;
use Peridot\Reporter\ListReporter\ListReporterPlugin;
error_reporting(-1);
return function (EventEmitterInterface $emitter) {
$watcher = new WatcherPlugin($emitter);
$watcher->track(__DIR__ . '/src');
$dot = new DotReporterPlugin($emitter);
$list = new ListReporterPlugin($emitter);
$coverage = new CodeCoverageReporters($emitter);
$coverage->register();
$prophecy = new ProphecyPlugin($emitter);
// set the default path
$emitter->on('peridot.start', function (Environment $environment) {
$environment->getDefinition()->getArgument('path')->setDefault('specs');
});
$emitter->on('code-coverage.start', function (AbstractCodeCoverageReporter $reporter) {
$reporter->addDirectoryToWhitelist(__DIR__ . '/src');
});
};