Completed
Pull Request — master (#612)
by
unknown
02:51
created

Formula::getXml()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Box\Spout\Writer\XLSX;
4
5
/**
6
 * Class Formula
7
 *
8
 * @package Box\Spout\Reader\XLSX
9
 */
10
class Formula
11
{
12
13
14
    /**
15
     * @var string
16
     */
17
    protected $formula;
18
19
    /**
20
     * @var string
21
     */
22
    protected $value = '0';
23
24
    /**
25
     * Formula constructor.
26
     * @param string $formula
27
     * @param string $value
28
     */
29 1
    public function __construct($formula, $value = '0')
30
    {
31 1
        $this->formula = $formula;
32 1
        $this->value = $value;
33 1
    }
34
35 1
    public function getXml()
36
    {
37 1
        return '><f>' . $this->formula . '</f><v>' . $this->value . '</v></c>';
38
    }
39
40
}