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

ShouldFailChecker::shouldFail()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
rs 10
ccs 2
cts 2
cp 1
cc 1
nc 1
nop 2
crap 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