StringField   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getValue() 0 4 1
A setValue() 0 4 1
1
<?php
2
3
/*
4
 * (c) Jim Martens <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace TwoMartens\Bundle\CoreBundle\Field;
11
12
/**
13
 * Represents an string field.
14
 *
15
 * @author    Jim Martens <[email protected]>
16
 * @copyright 2013-2015 Jim Martens
17
 */
18
class StringField extends AbstractField
19
{
20
    /**
21
     * Initializes the StringField.
22
     *
23
     * @param string $value
24
     */
25
    public function __construct($value)
26
    {
27
        parent::__construct($value, 'string');
28
    }
29
30
    /**
31
     * Returns the value of this field.
32
     *
33
     * @return string
34
     */
35
    public function getValue()
36
    {
37
        return parent::getValue();
38
    }
39
40
    /**
41
     * Sets the value of the field.
42
     *
43
     * @param string $value
44
     *
45
     * @throws \InvalidArgumentException if the value is not a string
46
     */
47
    public function setValue($value)
48
    {
49
        parent::setValue($value);
50
    }
51
}
52