Completed
Push — master ( d83119...6e6854 )
by Jakub
01:39
created

ShouldFailChecker   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 6
c 1
b 0
f 1
dl 0
loc 13
rs 10
wmc 2

2 Methods

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