-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
kahlan-config.php
38 lines (31 loc) · 1.19 KB
/
kahlan-config.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
35
36
37
38
<?php
use Laminas\ServiceManager\AbstractPluginManager;
use Kahlan\Filter\Filters;
use Kahlan\Reporter\Coverage;
use Kahlan\Reporter\Coverage\Driver\Xdebug;
// autoload hack
class_alias(AbstractPluginManager::class, Zend\ServiceManager\AbstractPluginManager::class);
Filters::apply($this, 'coverage', function($next): void {
if (! extension_loaded('xdebug')) {
return;
}
$reporters = $this->reporters();
$coverage = new Coverage([
'verbosity' => $this->commandLine()->get('coverage'),
'driver' => new Xdebug(),
'path' => $this->commandLine()->get('src'),
'exclude' => [
// laminas-cli preview console command
'src/Command/Preview/ErrorPreviewConsoleCommand.php',
// laminas-mvc preview page
'src/Controller/ErrorPreviewController.php',
// mezzio preview page
'src/Middleware/Routed/Preview/ErrorPreviewAction.php',
// compatible code
'src/Compat/Logger.php',
'src/Compat/LoggerAbstractServiceFactory.php'
],
'colors' => ! $this->commandLine()->get('no-colors')
]);
$reporters->add('coverage', $coverage);
});