RelationshipsLoader   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 30
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
 * Relationships loader
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 RelationshipsLoader
13
{
14
    /**
15
     *
16
     * @var string
17
     */
18
    protected $relationshipClass;
19
20
    /**
21
     * Constructor
22
     *
23
     * @param string $relationshipClass The class of the relationship objects
24
     */
25
    public function __construct($relationshipClass)
26
    {
27
        $this->relationshipClass = $relationshipClass;
28
    }
29
30
    /**
31
     * Opens a relationships file
32
     *
33
     * @param string $path
34
     *
35
     * @return Relationships
36
     */
37
    public function open($path)
38
    {
39
        return new $this->relationshipClass($path);
40
    }
41
}
42