SharedStringsLoader   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A open() 0 4 1
1
<?php
2
3
namespace Akeneo\Component\SpreadsheetParser\Xlsx;
4
5
/**
6
 * SharedStrings 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 SharedStringsLoader
13
{
14
15
    /**
16
     *
17
     * @var string
18
     */
19
    protected $sharedStringsClass;
20
21
    /**
22
     * Constructor
23
     *
24
     * @param string $sharedStringsClass The class for created objects
25
     */
26
    public function __construct($sharedStringsClass)
27
    {
28
        $this->sharedStringsClass = $sharedStringsClass;
29
    }
30
31
    /**
32
     * Creates a SharedStrings from the archive
33
     *
34
     * @param string  $path
35
     * @param Archive $archive The Archive from which the path was extracted
36
     *
37
     * @return SharedStrings
38
     */
39
    public function open($path, Archive $archive)
40
    {
41
        return new $this->sharedStringsClass($path, $archive);
42
    }
43
44
}
45