State   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 7
c 1
b 0
f 0
dl 0
loc 34
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A name() 0 3 1
A value() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
namespace Tleckie\DesignPatterns\Memento;
4
5
/**
6
 * Class State
7
 *
8
 * @package Tleckie\DesignPatterns\Memento
9
 * @author  Teodoro Leckie Westberg <[email protected]>
10
 */
11
class State
12
{
13
    /** @var string */
14
    private string $name;
15
16
    /** @var string */
17
    private string $value;
18
19
    /**
20
     * State constructor.
21
     *
22
     * @param string $name
23
     * @param string $value
24
     */
25
    public function __construct(string $name, string $value)
26
    {
27
        $this->name = $name;
28
        $this->value = $value;
29
    }
30
31
    /**
32
     * @return string
33
     */
34
    public function name(): string
35
    {
36
        return $this->name;
37
    }
38
39
    /**
40
     * @return string
41
     */
42
    public function value(): string
43
    {
44
        return $this->value;
45
    }
46
}
47