CommentedItem   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 36
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getComment() 0 3 1
A __construct() 0 5 1
A getItem() 0 3 1
1
<?php
2
3
4
namespace TheAentMachine\Yaml;
5
6
class CommentedItem
7
{
8
    /**
9
     * @var mixed
10
     */
11
    private $item;
12
    /**
13
     * @var string|null
14
     */
15
    private $comment;
16
17
    /**
18
     * @param mixed $item
19
     * @param string|null $comment
20
     */
21
    public function __construct($item, ?string $comment)
22
    {
23
24
        $this->item = $item;
25
        $this->comment = $comment;
26
    }
27
28
    /**
29
     * @return mixed
30
     */
31
    public function getItem()
32
    {
33
        return $this->item;
34
    }
35
36
    /**
37
     * @return string|null
38
     */
39
    public function getComment(): ?string
40
    {
41
        return $this->comment;
42
    }
43
}
44