Passed
Push — master ( db5c4e...adaaa2 )
by Kirill
03:03
created

NameValue::jsonSerialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\Tests\Models;
13
14
use Spiral\Models\ValueInterface;
15
16
class NameValue implements ValueInterface
17
{
18
    private $value;
19
20
    public function __construct($value)
21
    {
22
        $this->setValue((string)$value);
23
    }
24
25
    public function __toString(): string
26
    {
27
        return $this->value;
28
    }
29
30
    public function setValue($data): void
31
    {
32
        $this->value = strtoupper($data);
33
    }
34
35
    public function getValue()
36
    {
37
        return $this->value;
38
    }
39
40
    public function jsonSerialize()
41
    {
42
        return $this->value;
43
    }
44
}
45