@@ -30,16 +30,16 @@ private function __construct(CodeCoverage $codeCoverage, $storageDirectory, $cov
30
30
}
31
31
32
32
/**
33
- * @param callable $coverageEnabled
33
+ * @param bool $collectCodeCoverage
34
34
* @param string $storageDirectory
35
35
* @param string|null $phpunitConfigFilePath
36
36
* @param string $coverageId
37
37
* @return callable
38
38
*/
39
- public static function bootstrap ($ coverageEnabled , $ storageDirectory , $ phpunitConfigFilePath = null , $ coverageId = 'live-coverage ' )
39
+ public static function bootstrap ($ collectCodeCoverage , $ storageDirectory , $ phpunitConfigFilePath = null , $ coverageId = 'live-coverage ' )
40
40
{
41
- Assert::isCallable ( $ coverageEnabled );
42
- if (!$ coverageEnabled () ) {
41
+ Assert::boolean ( $ collectCodeCoverage );
42
+ if (!$ collectCodeCoverage ) {
43
43
return function () {
44
44
// do nothing - code coverage is not enabled
45
45
};
@@ -60,15 +60,15 @@ public static function bootstrap($coverageEnabled, $storageDirectory, $phpunitCo
60
60
}
61
61
62
62
/**
63
- * @param callable $coverageEnabled
63
+ * @param bool $coverageEnabled
64
64
* @param string $storageDirectory
65
65
* @param null $phpunitConfigFilePath
66
66
* @return callable
67
67
*/
68
68
public static function bootstrapRemoteCoverage ($ coverageEnabled , $ storageDirectory , $ phpunitConfigFilePath = null )
69
69
{
70
- Assert::isCallable ($ coverageEnabled );
71
- if (!$ coverageEnabled() ) {
70
+ Assert::boolean ($ coverageEnabled );
71
+ if (!$ coverageEnabled ) {
72
72
return function () {
73
73
// do nothing - code coverage is not enabled
74
74
};
@@ -87,7 +87,12 @@ public static function bootstrapRemoteCoverage($coverageEnabled, $storageDirecto
87
87
$ coverageId = isset ($ _GET ['coverage_id ' ]) ? $ _GET ['coverage_id ' ] :
88
88
(isset ($ _COOKIE ['coverage_id ' ]) ? $ _COOKIE ['coverage_id ' ] : 'live-coverage ' );
89
89
90
- return self ::bootstrap ($ coverageEnabled , $ storageDirectory , $ phpunitConfigFilePath , $ coverageId );
90
+ return self ::bootstrap (
91
+ isset ($ _COOKIE ['collect_code_coverage ' ]) && (bool )$ _COOKIE ['collect_code_coverage ' ],
92
+ $ storageDirectory ,
93
+ $ phpunitConfigFilePath ,
94
+ $ coverageId
95
+ );
91
96
}
92
97
93
98
private function start ()
0 commit comments