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

ShouldFailChecker::shouldFail()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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