MetadataModel::setValue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 6
Ratio 100 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 6
loc 6
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
/*
4
 * This file is part of the zibios/wrike-php-jmsserializer package.
5
 *
6
 * (c) Zbigniew Ślązak
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Zibios\WrikePhpJmsserializer\Model\Common;
13
14
use JMS\Serializer\Annotation as SA;
15
use Zibios\WrikePhpJmsserializer\Model\AbstractModel;
16
use Zibios\WrikePhpJmsserializer\Model\ResourceModelInterface;
17
18
/**
19
 * Metadata Model.
20
 */
21 View Code Duplication
class MetadataModel extends AbstractModel implements ResourceModelInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
22
{
23
    /**
24
     * Key should be less than 50 symbols and match following regular expression ([A-Za-z0-9_-]+).
25
     *
26
     * @SA\Type("string")
27
     * @SA\SerializedName("key")
28
     *
29
     * @var string|null
30
     */
31
    protected $key;
32
33
    /**
34
     * Value should be less than 1000 symbols, compatible with JSON string.
35
     * Use JSON 'null' in order to remove metadata entry.
36
     *
37
     * @SA\Type("string")
38
     * @SA\SerializedName("value")
39
     *
40
     * @var string|null
41
     */
42
    protected $value;
43
44
    /**
45
     * @return null|string
46
     */
47 1
    public function getKey()
48
    {
49 1
        return $this->key;
50
    }
51
52
    /**
53
     * @param null|string $key
54
     *
55
     * @return $this
56
     */
57 1
    public function setKey($key)
58
    {
59 1
        $this->key = $key;
60
61 1
        return $this;
62
    }
63
64
    /**
65
     * @return null|string
66
     */
67 1
    public function getValue()
68
    {
69 1
        return $this->value;
70
    }
71
72
    /**
73
     * @param null|string $value
74
     *
75
     * @return $this
76
     */
77 1
    public function setValue($value)
78
    {
79 1
        $this->value = $value;
80
81 1
        return $this;
82
    }
83
}
84