-return function(EventEmitter $emitter) {
- (new CodeCoverageReporters($emitter))->register();
-
- $emitter->on('peridot.reporters', function(InputInterface $input, ReporterFactory $reporterFactory) {
- $reporterFactory->register(
- 'seekat',
- 'Spec + Text Code coverage reporter',
- function(AnonymousReporter $ar) use ($reporterFactory) {
-
- return new class($reporterFactory, $ar->getConfiguration(), $ar->getOutput(), $ar->getEventEmitter()) extends AbstractBaseReporter {
- private $reporters = [];
-
- function __construct(ReporterFactory $factory, Configuration $configuration, OutputInterface $output, EventEmitter $eventEmitter) {
- fprintf(STDERR, "Creating reporters\n");
- $this->reporters[] = $factory->create("spec");
- $this->reporters[] = $factory->create("text-code-coverage");
- parent::__construct($configuration, $output, $eventEmitter);
- }
-
- function init() {
- }
- function __2call($method, array $args) {
- fprintf(STDERR, "Calling %s\n", $method);
- foreach ($this->reporters as $reporter) {
- $output = $reporter->$method(...$args);
- }
- return $output;
- }
- };
- }
- );
- });
-
- $emitter->on('code-coverage.start', function (AbstractCodeCoverageReporter $reporter) {
- $reporter->addDirectoryToWhitelist(__DIR__."/lib")
- ->addDirectoryToWhitelist(__DIR__."/tests");
- });