StylesLoader::open()   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\Xlsx;
4
5
/**
6
 * Styles 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 StylesLoader
13
{
14
    /**
15
     * @var string
16
     */
17
    protected $class;
18
19
    /**
20
     * Constructor
21
     *
22
     * @param string $class The class for created objects
23
     */
24
    public function __construct($class)
25
    {
26
        $this->class = $class;
27
    }
28
29
    /**
30
     * Creates a Styles from the archive
31
     *
32
     * @param string  $path
33
     * @param Archive $archive The Archive from which the path was extracted
34
     *
35
     * @return Styles
36
     */
37
    public function open($path, Archive $archive)
38
    {
39
        return new $this->class($path, $archive);
40
    }
41
}
42