AbstractFileIterator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A setDefaultOptions() 0 3 1
1
<?php
2
3
namespace Pim\Bundle\ExcelConnectorBundle\Iterator;
4
5
use Symfony\Component\OptionsResolver\OptionsResolver;
6
7
/**
8
 * Abstract file iterator
9
 *
10
 * @author    Antoine Guigan <[email protected]>
11
 * @copyright 2013 Akeneo SAS (http://www.akeneo.com)
12
 * @license   http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
13
 */
14
abstract class AbstractFileIterator implements \Iterator
15
{
16
    /** @var string */
17
    protected $filePath;
18
19
    /** @var array */
20
    protected $options;
21
22
    /**
23
     * @param string $filePath
24
     * @param array  $options
25
     */
26
    public function __construct($filePath, array $options = array())
27
    {
28
        $this->filePath = $filePath;
29
        $resolver = new OptionsResolver;
30
        $this->setDefaultOptions($resolver);
31
        $this->options = $resolver->resolve($options);
32
    }
33
34
    /**
35
     * Sets the default options
36
     *
37
     * @param OptionsResolver $resolver
38
     */
39
    protected function setDefaultOptions(OptionsResolver $resolver)
40
    {
41
    }
42
}
43