Passed
Push — master ( 7b52e4...d40832 )
by Jakub
01:50
created

ShouldFailChecker   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 2
eloc 6
c 2
b 0
f 1
dl 0
loc 16
rs 10
ccs 5
cts 5
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A shouldFail() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MyTester;
6
7
use MyTester\Annotations\Reader;
8
9
/**
10
 * ShouldFailChecker
11
 *
12
 * @author Jakub Konečný
13
 * @internal
14
 */
15
final class ShouldFailChecker
16
{
17
    use \Nette\SmartObject;
18
19
    public const ANNOTATION_NAME = "fail";
20
21
    private Reader $annotationsReader;
22
23 1
    public function __construct(Reader $annotationsReader)
24
    {
25 1
        $this->annotationsReader = $annotationsReader;
26 1
    }
27
28 1
    public function shouldFail(string $class, string $method): bool
29
    {
30 1
        return $this->annotationsReader->hasAnnotation(static::ANNOTATION_NAME, $class, $method);
31
    }
32
}
33