Result::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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