ExcelReaderFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 32
ccs 6
cts 6
cp 1
rs 10
c 1
b 1
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getReader() 0 4 1
1
<?php
2
3
namespace Port\Excel;
4
5
use Port\Reader\ReaderFactory;
6
7
/**
8
 * Factory that creates ExcelReaders
9
 *
10
 * @author David de Boer <[email protected]>
11
 */
12
class ExcelReaderFactory implements ReaderFactory
13
{
14
    /**
15
     * @var integer
16
     */
17
    protected $headerRowNumber;
18
19
    /**
20
     * @var integer
21
     */
22
    protected $activeSheet;
23
24
    /**
25
     * @param integer $headerRowNumber
26
     * @param integer $activeSheet
27
     */
28 1
    public function __construct($headerRowNumber = null, $activeSheet = null)
29
    {
30 1
        $this->headerRowNumber = $headerRowNumber;
31 1
        $this->activeSheet = $activeSheet;
32 1
    }
33
34
    /**
35
     * @param \SplFileObject $file
36
     *
37
     * @return ExcelReader
38
     */
39 1
    public function getReader(\SplFileObject $file)
40
    {
41 1
        return new ExcelReader($file, $this->headerRowNumber, $this->activeSheet);
42
    }
43
}
44