Completed
Push — master ( cac559...b1b643 )
by De Cramer
12s
created

PluginDescriptionFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 28
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A create() 0 6 1
1
<?php
2
3
namespace eXpansion\Core\Model\Plugin;
4
5
/**
6
 * Class PluginDescriptionFactory crates plugin description instances.
7
 *
8
 * @package eXpansion\Core\Model\Plugin
9
 * @author Oliver de Cramer
10
 */
11
class PluginDescriptionFactory
12
{
13
    protected $className;
14
15
    /**
16
     * PluginFactory constructor.
17
     *
18
     * @param $className
19
     */
20 1
    public function __construct($className)
21
    {
22 1
        $this->className = $className;
23 1
    }
24
25
    /**
26
     * Create an instance for a certain plugin.
27
     *
28
     * @param $pluginId
29
     *
30
     * @return PluginDescription
31
     */
32 1
    public function create($pluginId)
33
    {
34 1
        $class = $this->className;
35
36 1
        return new $class($pluginId);
37
    }
38
}
39