@@ -412,32 +412,38 @@ public function generateReports(Printer $printer, Configuration $configuration):
412412
413413 public function warnIfFilterIsNotConfigured (CodeCoverageFilterRegistry $ codeCoverageFilterRegistry , Configuration $ configuration ): void
414414 {
415- if ($ codeCoverageFilterRegistry ->get ()->isEmpty ()) {
416- if (!$ codeCoverageFilterRegistry ->configured ()) {
417- EventFacade::emitter ()->testRunnerTriggeredPhpunitWarning (
418- 'No filter is configured, code coverage will not be processed ' ,
419- );
420- } else {
421- $ paths = [];
415+ if (!$ codeCoverageFilterRegistry ->get ()->isEmpty ()) {
416+ return ;
417+ }
422418
423- foreach ($ configuration ->source ()->includeDirectories () as $ directory ) {
424- $ paths [] = $ directory ->path ();
425- }
419+ if (!$ codeCoverageFilterRegistry ->configured ()) {
420+ EventFacade::emitter ()->testRunnerTriggeredPhpunitWarning (
421+ 'No filter is configured, code coverage will not be processed ' ,
422+ );
426423
427- foreach ($ configuration ->source ()->includeFiles () as $ file ) {
428- $ paths [] = $ file ->path ();
429- }
424+ $ this ->deactivate ();
430425
431- EventFacade::emitter ()->testRunnerTriggeredPhpunitWarning (
432- sprintf (
433- 'Configured source filter (include-path: %s) does not match any files, code coverage will not be processed ' ,
434- implode (', ' , $ paths ),
435- ),
436- );
437- }
426+ return ;
427+ }
438428
439- $ this ->deactivate ();
429+ $ paths = [];
430+
431+ foreach ($ configuration ->source ()->includeDirectories () as $ directory ) {
432+ $ paths [] = $ directory ->path ();
433+ }
434+
435+ foreach ($ configuration ->source ()->includeFiles () as $ file ) {
436+ $ paths [] = $ file ->path ();
440437 }
438+
439+ EventFacade::emitter ()->testRunnerTriggeredPhpunitWarning (
440+ sprintf (
441+ 'Configured source filter (include-path: %s) does not match any files, code coverage will not be processed ' ,
442+ implode (', ' , $ paths ),
443+ ),
444+ );
445+
446+ $ this ->deactivate ();
441447 }
442448
443449 private function activate (Filter $ filter , bool $ pathCoverage ): void
0 commit comments