Result   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Drupal\qa;
6
7
/**
8
 * Result represents the results of a single step in a QaCheck.
9
 *
10
 * Multiple Result values can be present in a Pass, each keyed under its name.
11
 */
12
class Result {
13
14
  /**
15
   * Data can be anything serializable.
16
   *
17
   * @var mixed
18
   */
19
  public $data;
20
21
  /**
22
   * The name of the key under which to store the results in a QaCheck Pass.
23
   *
24
   * @var string
25
   */
26
  public $name;
27
28
  /**
29
   * Did the QaCheck pass?
30
   *
31
   * @var bool
32
   */
33
  public $ok;
34
35
  /**
36
   * Result constructor.
37
   *
38
   * @param string $name
39
   *   The name of the sub-check for which this is a result.
40
   * @param bool $ok
41
   *   Did that sub-check succeed ?
42
   * @param mixed $data
43
   *   Serializable sub-check results.
44
   */
45
  public function __construct(string $name, bool $ok, $data = NULL) {
46
    $this->name = $name;
47
    $this->ok = $ok;
48
    $this->data = $data;
49
  }
50
51
}
52