Completed
Pull Request — master (#557)
by Adrien
03:10
created

Workbook::getInternalId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

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
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Box\Spout\Writer\Common\Entity;
4
5
/**
6
 * Class Workbook
7
 * Entity describing a workbook
8
 */
9
class Workbook
10
{
11
    /** @var Worksheet[] List of the workbook's sheets */
12
    private $worksheets = [];
13
14
    /** @var string Timestamp based unique ID identifying the workbook */
15
    private $internalId;
16
17
    /**
18
     * Workbook constructor.
19
     */
20 77
    public function __construct()
21
    {
22 77
        $this->internalId = uniqid();
23 77
    }
24
25
    /**
26
     * @return Worksheet[]
27
     */
28 77
    public function getWorksheets()
29
    {
30 77
        return $this->worksheets;
31
    }
32
33
    /**
34
     * @param Worksheet[] $worksheets
35
     */
36 77
    public function setWorksheets($worksheets)
37
    {
38 77
        $this->worksheets = $worksheets;
39 77
    }
40
41
    /**
42
     * @return string
43
     */
44 77
    public function getInternalId()
45
    {
46 77
        return $this->internalId;
47
    }
48
}
49