Validator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A isValidMethod() 0 9 2
1
<?php
2
3
namespace OckCyp\CoversValidator\Validator;
4
5
use PHPUnit\Framework\CodeCoverageException;
6
use PHPUnit\Util\Test;
7
8
class Validator
9
{
10
    /**
11
     * Check if the method has valid @covers and @uses tags
12
     *
13
     * @param string $class
14
     * @param string $method
15
     *
16
     * @return bool
17
     */
18
    public static function isValidMethod($class, $method)
19
    {
20
        try {
21
            Test::getLinesToBeCovered($class, $method);
22
        } catch (CodeCoverageException $e) {
23
            return false;
24
        }
25
26
        return true;
27
    }
28
}
29