Completed
Push — 0.11.x ( 7819b6...bc0e2a )
by Markus
56:26 queued 36:36
created

StringValue::getValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 4
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * This file is part of the eluceo/iCal package.
5
 *
6
 * (c) Markus Poerschke <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Eluceo\iCal\Property;
13
14
use Eluceo\iCal\Util\PropertyValueUtil;
15
16 View Code Duplication
class StringValue implements ValueInterface
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...
17
{
18
    /**
19
     * The value.
20
     *
21
     * @var string
22
     */
23
    protected $value;
24
25 15
    public function __construct($value)
26
    {
27 15
        $this->value = $value;
28 15
    }
29
30
    /**
31
     * Return the value of the Property as an escaped string.
32
     *
33
     * Escape values as per RFC 2445. See http://www.kanzaki.com/docs/ical/text.html
34
     *
35
     * @return string
36
     */
37 13
    public function getEscapedValue()
38
    {
39 13
        return PropertyValueUtil::escapeValue((string) $this->value);
40
    }
41
42
    /**
43
     * @param string $value
44
     *
45
     * @return $this
46
     */
47
    public function setValue($value)
48
    {
49
        $this->value = $value;
50
51
        return $this;
52
    }
53
54
    /**
55
     * @return string
56
     */
57 1
    public function getValue()
58
    {
59 1
        return $this->value;
60
    }
61
}
62