AbstractFileIterator::setDefaultOptions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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