Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
HistoryStep | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace Drupal\display_builder; |
6 | |
7 | use Drupal\Component\Render\FormattableMarkup; |
8 | use Symfony\Component\Validator\Constraints as Assert; |
9 | |
10 | /** |
11 | * A single step in the instance log history. |
12 | */ |
13 | class HistoryStep { |
14 | |
15 | /** |
16 | * Construct an history step. |
17 | * |
18 | * @param array $data |
19 | * An UI Patterns sources tree. |
20 | * @param int $hash |
21 | * An unique hash, as an crc32 checksum integer. |
22 | * @param \Drupal\Component\Render\FormattableMarkup|string|null $log |
23 | * A log message. |
24 | * @param int $time |
25 | * A timestamp. |
26 | * @param ?int $user |
27 | * A Drupal user entity ID. |
28 | */ |
29 | public function __construct( |
30 | #[Assert\Type('list')] |
31 | // Writable because of Instance::postCreate(). |
32 | public array $data, |
33 | public readonly int $hash, |
34 | public readonly null|FormattableMarkup|string $log, |
35 | #[Assert\Positive] |
36 | public readonly int $time, |
37 | #[Assert\PositiveOrZero] |
38 | public readonly ?int $user, |
39 | ) {} |
40 | |
41 | } |