RowIteratorFactory::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
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