Completed
Pull Request — develop_3.0 (#427)
by Adrien
02:25
created

Workbook::setWorksheets()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Box\Spout\Writer\Entity;
4
5
/**
6
 * Class Workbook
7
 * Entity describing a workbook
8
 *
9
 * @package Box\Spout\Writer\Entity
10
 */
11
class Workbook
12
{
13
    /** @var Worksheet[] List of the workbook's sheets */
14
    private $worksheets = [];
15
16
    /** @var string Timestamp based unique ID identifying the workbook */
17
    private $internalId;
18
19
    /**
20
     * Workbook constructor.
21
     */
22 89
    public function __construct()
23
    {
24 89
        $this->internalId = uniqid();
25 89
    }
26
27
    /**
28
     * @return Worksheet[]
29
     */
30 89
    public function getWorksheets()
31
    {
32 89
        return $this->worksheets;
33
    }
34
35
    /**
36
     * @param Worksheet[] $worksheets
37
     */
38 89
    public function setWorksheets($worksheets)
39
    {
40 89
        $this->worksheets = $worksheets;
41 89
    }
42
43
    /**
44
     * @return string
45
     */
46 89
    public function getInternalId()
47
    {
48 89
        return $this->internalId;
49
    }
50
51
    /**
52
     * @param string $internalId
53
     */
54
    public function setInternalId($internalId)
55
    {
56
        $this->internalId = $internalId;
57
    }
58
}