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

Workbook   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 76.92%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 48
ccs 10
cts 13
cp 0.7692
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getWorksheets() 0 4 1
A setWorksheets() 0 4 1
A getInternalId() 0 4 1
A setInternalId() 0 4 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
}