Completed
Push — master ( c18ee0...6804db )
by Sébastien
14:50
created

DecimalColumn   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 99
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 2 Features 0
Metric Value
wmc 7
c 2
b 2
f 0
lcom 0
cbo 1
dl 0
loc 99
ccs 0
cts 31
cp 0
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getNumericUnsigned() 0 4 1
A setNumericUnsigned() 0 5 1
A isNumericUnsigned() 0 4 1
A getNumericPrecision() 0 4 1
A setNumericPrecision() 0 5 1
A getNumericScale() 0 4 1
A setNumericScale() 0 5 1
1
<?php
2
3
namespace Soluble\Db\Metadata\Column\Definition;
4
5
class DecimalColumn extends AbstractColumnDefinition implements NumericColumnInterface
6
{
7
    /**
8
     *
9
     * @var int
10
     */
11
    protected $numericPrecision = null;
12
13
    /**
14
     *
15
     * @var int
16
     */
17
    protected $numericScale = null;
18
19
20
    /**
21
     *
22
     * @var boolean
23
     */
24
    protected $numericUnsigned = null;
25
26
27
    /**
28
     * @return bool
29
     */
30
    public function getNumericUnsigned()
31
    {
32
        return $this->numericUnsigned;
33
    }
34
35
    /**
36
     * @param  bool $numericUnsigned
37
     * @return DecimalColumn
38
     */
39
    public function setNumericUnsigned($numericUnsigned)
40
    {
41
        $this->numericUnsigned = $numericUnsigned;
42
        return $this;
43
    }
44
45
46
    /**
47
     * @return bool
48
     */
49
    public function isNumericUnsigned()
50
    {
51
        return $this->numericUnsigned;
52
    }
53
54
    /**
55
     * Return the precision, for example
56
     * salary DECIMAL(5,2)
57
     * In this example, 5 is the precision and 2 is the scale.
58
     * Standard SQL requires that DECIMAL(5,2) be able to store any value
59
     * with five digits and two decimals, so values that can be stored in
60
     * the salary column range from -999.99 to 999.99.
61
     *
62
     * @return int the $numericPrecision
63
     */
64
    public function getNumericPrecision()
65
    {
66
        return $this->numericPrecision;
67
    }
68
69
    /**
70
     * @param int $numericPrecision the $numericPrevision to set
71
     * @return DecimalColumn
72
     */
73
    public function setNumericPrecision($numericPrecision)
74
    {
75
        $this->numericPrecision = $numericPrecision;
76
        return $this;
77
    }
78
79
    /**
80
     * Return the scale (number of decimal digits)
81
     * salary DECIMAL(5,2)
82
     * In this example, 5 is the precision and 2 is the scale.
83
     * Standard SQL requires that DECIMAL(5,2) be able to store any value
84
     * with five digits and two decimals, so values that can be stored in
85
     * the salary column range from -999.99 to 999.99.
86
     *
87
     * @return integer the $numericScale
88
     */
89
    public function getNumericScale()
90
    {
91
        return $this->numericScale;
92
    }
93
94
    /**
95
     * @param integer $numericScale the $numericScale to set
96
     * @return DecimalColumn
97
     */
98
    public function setNumericScale($numericScale)
99
    {
100
        $this->numericScale = $numericScale;
101
        return $this;
102
    }
103
}
104