Skip to content

Commit f2a6aaf

Browse files
Merge branch 'master' of github.com:sebastianbergmann/php-code-coverage into report-refactoring
2 parents f4aa00a + 32413ea commit f2a6aaf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

PHP/CodeCoverage/Util.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,8 @@ protected static function resolveCoversToReflectionObjects($coveredElement)
531531
);
532532
} else {
533533
if (!((class_exists($className) ||
534-
interface_exists($className)) &&
534+
interface_exists($className) ||
535+
trait_exists($className)) &&
535536
method_exists($className, $methodName))) {
536537
throw new RuntimeException(
537538
sprintf(
@@ -571,7 +572,8 @@ class_parents($coveredElement)
571572

572573
foreach ($classes as $className) {
573574
if (!class_exists($className) &&
574-
!interface_exists($className)) {
575+
!interface_exists($className) &&
576+
!trait_exists($className)) {
575577
throw new RuntimeException(
576578
sprintf(
577579
'Trying to @cover not existing class or ' .

0 commit comments

Comments
 (0)