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

NameValue   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A setValue() 0 3 1
A getValue() 0 3 1
A jsonSerialize() 0 3 1
A __toString() 0 3 1
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