@@ -30,16 +30,16 @@ private function __construct(CodeCoverage $codeCoverage, $storageDirectory, $cov
3030 }
3131
3232 /**
33- * @param callable $coverageEnabled
33+ * @param bool $collectCodeCoverage
3434 * @param string $storageDirectory
3535 * @param string|null $phpunitConfigFilePath
3636 * @param string $coverageId
3737 * @return callable
3838 */
39- public static function bootstrap ($ coverageEnabled , $ storageDirectory , $ phpunitConfigFilePath = null , $ coverageId = 'live-coverage ' )
39+ public static function bootstrap ($ collectCodeCoverage , $ storageDirectory , $ phpunitConfigFilePath = null , $ coverageId = 'live-coverage ' )
4040 {
41- Assert::isCallable ( $ coverageEnabled );
42- if (!$ coverageEnabled () ) {
41+ Assert::boolean ( $ collectCodeCoverage );
42+ if (!$ collectCodeCoverage ) {
4343 return function () {
4444 // do nothing - code coverage is not enabled
4545 };
@@ -60,15 +60,15 @@ public static function bootstrap($coverageEnabled, $storageDirectory, $phpunitCo
6060 }
6161
6262 /**
63- * @param callable $coverageEnabled
63+ * @param bool $coverageEnabled
6464 * @param string $storageDirectory
6565 * @param null $phpunitConfigFilePath
6666 * @return callable
6767 */
6868 public static function bootstrapRemoteCoverage ($ coverageEnabled , $ storageDirectory , $ phpunitConfigFilePath = null )
6969 {
70- Assert::isCallable ($ coverageEnabled );
71- if (!$ coverageEnabled() ) {
70+ Assert::boolean ($ coverageEnabled );
71+ if (!$ coverageEnabled ) {
7272 return function () {
7373 // do nothing - code coverage is not enabled
7474 };
@@ -87,7 +87,12 @@ public static function bootstrapRemoteCoverage($coverageEnabled, $storageDirecto
8787 $ coverageId = isset ($ _GET ['coverage_id ' ]) ? $ _GET ['coverage_id ' ] :
8888 (isset ($ _COOKIE ['coverage_id ' ]) ? $ _COOKIE ['coverage_id ' ] : 'live-coverage ' );
8989
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+ );
9196 }
9297
9398 private function start ()
0 commit comments