mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 00:07:22 +01:00
Improves coverage feedback
This commit is contained in:
@ -36,7 +36,21 @@ final class Coverage
|
||||
*/
|
||||
public static function isAvailable(): bool
|
||||
{
|
||||
return (new Runtime())->canCollectCodeCoverage();
|
||||
$runtime = new Runtime();
|
||||
|
||||
if (! $runtime->canCollectCodeCoverage()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($runtime->hasXdebug()) {
|
||||
if (version_compare((string) phpversion('xdebug'), '3.1', '>=')) {
|
||||
if (! in_array('coverage', xdebug_info('mode'), true)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user