Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 1
TipNode
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 4
20
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
 getData
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getMessageKey
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getType
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace GrowthExperiments\HelpPanel\Tips;
4
5/**
6 * Value object for containing data about a tip node, which roughly corresponds
7 * to an HTML node.
8 */
9class TipNode {
10    /**
11     * @var string
12     */
13    private $type;
14    /**
15     * @var array
16     */
17    private $data;
18    /**
19     * @var string
20     */
21    private $messageKey;
22
23    /**
24     * @param string $type
25     * @param string $messageKey
26     * @param array $data
27     */
28    public function __construct(
29        string $type, string $messageKey, array $data = [] ) {
30        $this->type = $type;
31        $this->data = $data;
32        $this->messageKey = $messageKey;
33    }
34
35    /**
36     * @return array
37     */
38    public function getData(): array {
39        return $this->data;
40    }
41
42    /**
43     * Get the message key if defined.
44     *
45     * @return string
46     */
47    public function getMessageKey(): string {
48        return $this->messageKey;
49    }
50
51    /**
52     * @return string
53     */
54    public function getType(): string {
55        return $this->type;
56    }
57}