Skip to content

Commit 9021391

Browse files
Remove flag specific to Xdebug from driver interface
1 parent c5f7c79 commit 9021391

File tree

4 files changed

+8
-24
lines changed

4 files changed

+8
-24
lines changed

src/Driver/Driver.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,8 @@ interface Driver
3838

3939
/**
4040
* Start collection of code coverage information.
41-
*
42-
* @param bool $determineUnusedAndDead
4341
*/
44-
public function start($determineUnusedAndDead = true);
42+
public function start();
4543

4644
/**
4745
* Stop collection of code coverage information.

src/Driver/HHVM.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ class HHVM extends Xdebug
1919
{
2020
/**
2121
* Start collection of code coverage information.
22-
*
23-
* @param bool $determineUnusedAndDead
2422
*/
25-
public function start($determineUnusedAndDead = true)
23+
public function start()
2624
{
2725
xdebug_start_code_coverage();
2826
}

src/Driver/PHPDBG.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@ public function __construct()
3939

4040
/**
4141
* Start collection of code coverage information.
42-
*
43-
* @param bool $determineUnusedAndDead
4442
*/
45-
public function start($determineUnusedAndDead = true)
43+
public function start()
4644
{
4745
phpdbg_start_oplog();
4846
}

src/Driver/Xdebug.php

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,25 @@ class Xdebug implements Driver
2727
private $cacheNumLines = [];
2828

2929
/**
30-
* Constructor.
30+
* @throws RuntimeException
3131
*/
3232
public function __construct()
3333
{
3434
if (!extension_loaded('xdebug')) {
3535
throw new RuntimeException('This driver requires Xdebug');
3636
}
3737

38-
if (version_compare(phpversion('xdebug'), '2.2.1', '>=') &&
39-
!ini_get('xdebug.coverage_enable')) {
40-
throw new RuntimeException(
41-
'xdebug.coverage_enable=On has to be set in php.ini'
42-
);
38+
if (version_compare(phpversion('xdebug'), '2.2.1', '>=') && !ini_get('xdebug.coverage_enable')) {
39+
throw new RuntimeException('xdebug.coverage_enable=On has to be set in php.ini');
4340
}
4441
}
4542

4643
/**
4744
* Start collection of code coverage information.
48-
*
49-
* @param bool $determineUnusedAndDead
5045
*/
51-
public function start($determineUnusedAndDead = true)
46+
public function start()
5247
{
53-
$options = 0;
54-
55-
if ($determineUnusedAndDead) {
56-
$options |= XDEBUG_CC_UNUSED;
57-
$options |= XDEBUG_CC_DEAD_CODE;
58-
}
48+
$options = XDEBUG_CC_DEAD_CODE | XDEBUG_CC_UNUSED;
5949

6050
xdebug_start_code_coverage($options);
6151
}

0 commit comments

Comments
 (0)