Passed
Pull Request — 8.x-1.x (#11)
by Frédéric G.
01:15
created

Result::__construct()   A

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
declare(strict_types = 1);
3
4
namespace Drupal\qa;
5
6
/**
7
 * Result represents the results of a single step in a QaCheck.
8
 *
9
 * Multiple Result values can be present in a Pass, each keyed under its name.
10
 */
11
class Result {
12
13
  /**
14
   * Data can be anything serializable.
15
   *
16
   * @var mixed
17
   */
18
  public $data;
19
20
  /**
21
   * The name of the key under which to store the results in a QaCheck Pass.
22
   *
23
   * @var string
24
   */
25
  public $name;
26
27
  /**
28
   * Did the QaCheck pass?
29
   *
30
   * @var bool
31
   */
32
  public $ok;
33
34
  /**
35
   * Result constructor.
36
   *
37
   * @param string $name
38
   * @param bool $status
39
   * @param null $data
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $data is correct as it would always require null to be passed?
Loading history...
40
   */
41
  public function __construct(string $name, bool $status, $data = NULL) {
42
    $this->name = $name;
43
    $this->ok = $status;
44
    $this->data = $data;
45
  }
46
}
47