Completed
Pull Request — develop_3.0 (#431)
by Adrien
02:35
created

EntityFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 20
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createWorkbook() 0 4 1
A createWorksheet() 0 4 1
1
<?php
2
3
namespace Box\Spout\Writer\Common\Creator;
4
5
use Box\Spout\Writer\Common\Sheet;
6
use Box\Spout\Writer\Common\Entity\Workbook;
7
use Box\Spout\Writer\Common\Entity\Worksheet;
8
9
/**
10
 * Class EntityFactory
11
 * Factory to create entities
12
 *
13
 * @package Box\Spout\Writer\Common\Creator
14
 */
15
class EntityFactory
16
{
17
    /**
18
     * @return Workbook
19
     */
20 89
    public function createWorkbook()
21
    {
22 89
        return new Workbook();
23
    }
24
25
    /**
26
     * @param string $worksheetFilePath
27
     * @param Sheet $externalSheet
28
     * @return Worksheet
29
     */
30 89
    public function createWorksheet($worksheetFilePath, Sheet $externalSheet)
31
    {
32 89
        return new Worksheet($worksheetFilePath, $externalSheet);
33
    }
34
}