RowIteratorFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 31
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A create() 0 4 1
1
<?php
2
3
namespace Akeneo\Component\SpreadsheetParser\Csv;
4
5
/**
6
 * Row iterator factory
7
 *
8
 * @author    Antoine Guigan <[email protected]>
9
 * @copyright 2014 Akeneo SAS (http://www.akeneo.com)
10
 * @license   http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
11
 */
12
class RowIteratorFactory
13
{
14
    /**
15
     * @var string
16
     */
17
    protected $iteratorClass;
18
19
    /**
20
     * Constructor
21
     *
22
     * @param string $iteratorClass the class for row iterators
23
     */
24
    public function __construct($iteratorClass)
25
    {
26
        $this->iteratorClass = $iteratorClass;
27
    }
28
29
    /**
30
     * Creates a row iterator for the XML given worksheet file
31
     *
32
     * @param string $path    the path to the extracted XML worksheet file
33
     * @param array  $options options specific to the format
34
     *
35
     * @return RowIterator
36
     */
37
    public function create($path, array $options)
38
    {
39
        return new $this->iteratorClass($path, $options);
40
    }
41
42
}
43